Skip to content

Conversation

@johnnychen94
Copy link
Member

@johnnychen94 johnnychen94 commented Oct 7, 2020

An edge case bug that gets Identified in #37829 (comment)

Integers should always be converted to Base.OneTo.

julia> LinearIndices((2, 1:3))
1×3 LinearIndices{2, Tuple{UnitRange{Int64}, UnitRange{Int64}}}:
 1  2  3

julia> LinearIndices((2, 3))
2×3 LinearIndices{2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}:
 1  3  5
 2  4  6

This PR:

julia> LinearIndices((2, 1:3))
2×3 LinearIndices{2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}:
 1  3  5
 2  4  6

@timholy timholy merged commit 3559b72 into JuliaLang:master Oct 9, 2020
@timholy
Copy link
Member

timholy commented Oct 9, 2020

Thanks!

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