You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in range.jl was presumably written under the assumption that all ranges (or all arrays) are 1-based. With IdentityUnitRange, this is not true anymore, and this leads to problems. I have found the following issues: For
u = 2:4
v = Base.IdentityUnitRange(2:4)
w = 1:9
one gets:
julia> axes(u) == axes(v), u == v # equal arrays must have equal axes
(false, true)
julia> w[v][2], w[v[2]] # the documentation defines w[v][i] to be w[v[i]]
(3, 2)
This happens with Julia 1.10.4, 1.11.0-beta2 and master.
EDIT: I've just noticed that while IdentityUnitRange has a docstring, it is not mentioned in the documentation. Maybe it is considered internal.
The text was updated successfully, but these errors were encountered:
I'm not so sure. My understanding is that #30950 is about some weird results when broadcasting over 1-element arrays. For the moment I've looked more closely at comparisons of ranges. I don't see why this couldn't be changed, but of course I might miss something. To get a better idea, I've created the PR #54825. Maybe this way one can see better what would happen with such a change.
The code in range.jl was presumably written under the assumption that all ranges (or all arrays) are 1-based. With
IdentityUnitRange
, this is not true anymore, and this leads to problems. I have found the following issues: Forone gets:
This happens with Julia 1.10.4, 1.11.0-beta2 and master.
EDIT: I've just noticed that while
IdentityUnitRange
has a docstring, it is not mentioned in the documentation. Maybe it is considered internal.The text was updated successfully, but these errors were encountered: