forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add methods to index identityUnitRange/Slice with another IdentityUni…
…tRange (JuliaLang#41224) Adding these methods lets `OffsetArrays` define `getindex(::AbstractUnitRange, ::IdentityUnitRange)` without ambiguities. This is in the domain of sanctioned type-piracy, as the result is an offset range in general and cannot be represented correctly using `Base` types. Re: JuliaArrays/OffsetArrays.jl#244 cc: @johnnychen94 Edit: this also fixes an indexing bug in `IdentityUntiRange`: master ```julia julia> r = Base.IdentityUnitRange(-3:3) Base.IdentityUnitRange(-3:3) julia> r[2] 2 julia> r[big(2)] -2 ``` Co-authored-by: jishnub <jishnub@users.noreply.github.com>
- Loading branch information
Showing
2 changed files
with
86 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters