Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid type widening to Int in range_stop_length #39283

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

sostock
Copy link
Contributor

@sostock sostock commented Jan 16, 2021

Currently, range(;stop, length) unnecessarily widens the eltype to Int:

julia> range(start=Int8(3), length=2) |> eltype
Int8

julia> range(stop=Int8(3), length=2) |> eltype
Int64

This PR fixes that by adapting the range_start_length logic for range_stop_length.

@JeffBezanson JeffBezanson merged commit 1045986 into JuliaLang:master Jan 20, 2021
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants