Skip to content

Commit

Permalink
Fix #30006, getindex accessing fields that might not exist (#30405)
Browse files Browse the repository at this point in the history
* Fix #30006, range getindex accessing fields that might not exist
* Add tests for #30006

(cherry picked from commit 64133f6)
  • Loading branch information
raghav9-97 authored and KristofferC committed Feb 20, 2020
1 parent e5d1501 commit 67ba3ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,13 @@ end
@test Base.Slice(1:10)[Int8(2)] == Int8(2)
end

@testset "Issue #30006" begin
@test Base.Slice(Base.OneTo(5))[Int32(1)] == Int32(1)
@test Base.Slice(Base.OneTo(3))[Int8(2)] == Int8(2)
@test Base.Slice(1:10)[Int32(2)] == Int32(2)
@test Base.Slice(1:10)[Int8(2)] == Int8(2)
end

@testset "allocation of TwicePrecision call" begin
0:286.493442:360
0:286:360
Expand Down

0 comments on commit 67ba3ca

Please sign in to comment.