https://github.com/JuliaLang/julia
Revision 6f8ba49e157d4b0de3726be8613a6ae607c5ccd2 authored by Jishnu Bhattacharya on 09 March 2024, 13:51:03 UTC, committed by GitHub on 09 March 2024, 13:51:03 UTC
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: https://github.com/JuliaArrays/OffsetArrays.jl/pull/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>
1 parent 18a2e70
History
Tip revision: 6f8ba49e157d4b0de3726be8613a6ae607c5ccd2 authored by Jishnu Bhattacharya on 09 March 2024, 13:51:03 UTC
Add methods to index identityUnitRange/Slice with another IdentityUnitRange (#41224)
Tip revision: 6f8ba49
File Mode Size
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.buildkite-external-version -rw-r--r-- 5 bytes
.clang-format -rw-r--r-- 3.3 KB
.clangd -rw-r--r-- 114 bytes
.codecov.yml -rw-r--r-- 52 bytes
.git-blame-ignore-revs -rw-r--r-- 371 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 571 bytes
.mailmap -rw-r--r-- 12.7 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 1012 bytes
CONTRIBUTING.md -rw-r--r-- 23.4 KB
HISTORY.md -rw-r--r-- 388.1 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 56.1 KB
Makefile -rw-r--r-- 30.3 KB
NEWS.md -rw-r--r-- 3.6 KB
README.md -rw-r--r-- 7.4 KB
THIRDPARTY.md -rw-r--r-- 3.9 KB
VERSION -rw-r--r-- 11 bytes
julia.spdx.json -rw-r--r-- 37.8 KB
pkgimage.mk -rw-r--r-- 1.4 KB
sysimage.mk -rw-r--r-- 4.2 KB
typos.toml -rw-r--r-- 78 bytes

README.md

back to top