-
Notifications
You must be signed in to change notification settings - Fork 18
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
Range indexing fails #78
Comments
I think that bug is there, but we can also avoid it by never making a |
As of Julia 1.5.0-DEV.207 (7d92a3aaed) this issue appears fixed: julia> r[1:2]
AnchoredInterval{Hour(-1),ZonedDateTime}(ZonedDateTime(2014, 1, 1, tz"America/Winnipeg"), Inclusivity(false, true)):Hour(1):AnchoredInterval{Hour(-1),ZonedDateTime}(ZonedDateTime(2014, 1, 1, 1, tz"America/Winnipeg"), Inclusivity(false, true)) Do we want to try and fix this on earlier versions of Julia? |
We should figure out the correct traits. If that fixes it for older versions of Julia, that would be a bonus. |
Another example of this issue but on Intervals 1.3 you just see a deprecation warning: julia> using Intervals
julia> x = AnchoredInterval{-1}(1):1:AnchoredInterval{-1}(5)
AnchoredInterval{-1,Int64,Open,Closed}(1):1:AnchoredInterval{-1,Int64,Open,Closed}(5)
julia> y = x[1:4];
julia> y
┌ Warning: `convert(T, interval::AnchoredInterval{P,T})` is deprecated for intervals which are not closed with coinciding endpoints. Use `anchor(interval)` instead.
│ caller = AnchoredInterval at anchoredinterval.jl:95 [inlined]
└ @ Core ~/.julia/dev/Intervals/src/anchoredinterval.jl:95
┌ Warning: `convert(T, interval::AnchoredInterval{P,T})` is deprecated for intervals which are not closed with coinciding endpoints. Use `anchor(interval)` instead.
│ caller = AnchoredInterval at anchoredinterval.jl:95 [inlined]
└ @ Core ~/.julia/dev/Intervals/src/anchoredinterval.jl:95
AnchoredInterval{-1,Int64,Open,Closed}(1):AnchoredInterval{-1,Int64,Open,Closed}(1):AnchoredInterval{-1,Int64,Open,Closed}(4) |
I attempted to use traits to fix this problem but that didn't actually seem to be the source of the failure. I instead implemented the fix in #132 and made a new issue for implementing traits. |
Range indexing appears to be taking a
StepRange
and making aStepRangeLen
, which we don't handle effectively.I think this might be a bug in
step(::StepRangeLen)
.The text was updated successfully, but these errors were encountered: