Commit d270a71
authored
isassigned for ranges with BigInt indices (#50587)
This fixes certain possible regressions in `isassigned` for ranges to
restore the 1.9-like behavior.
On v1.9
```julia
julia> r = 1:big(2)^65
1:36893488147419103232
julia> isassigned(r, lastindex(r))
true
julia> isassigned(r, true)
ERROR: ArgumentError: invalid index: true of type Bool
```
On v1.10.0-alpha1
```julia
julia> isassigned(r, lastindex(r))
ERROR: InexactError: Int64(36893488147419103232)
julia> isassigned(r, true) # Bool is converted to Int
true
julia> r[true] # but indexing with Bool doesn't work
ERROR: ArgumentError: invalid index: true of type Bool
```
This PR
```julia
julia> isassigned(r, lastindex(r))
true
julia> isassigned(r, true)
ERROR: ArgumentError: invalid index: true of type Bool
```
This still leaves
```julia
julia> isassigned(collect(1:3), true)
true
```
so that should perhaps be changed as well.1 parent 2cee483 commit d270a71
2 files changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
908 | | - | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
909 | 912 | | |
910 | 913 | | |
911 | 914 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2498 | 2498 | | |
2499 | 2499 | | |
2500 | 2500 | | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
0 commit comments