File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -4128,6 +4128,16 @@ module Ambig57404
41284128end
41294129@test Ambig57404. S == 1
41304130
4131+ # #57269
4132+ @testset """ var"begin"/var"end" in array index""" begin
4133+ @test (let var"end" = 1 ; (1 : 10 )[var"end" ]; end ) === 1
4134+ @test (let var"end" = 1 ; (1 : 10 )[end ]; end ) === 10
4135+ @test (let var"begin" = 2 ; (1 : 10 )[2 var"begin" + 1 ]; end ) === 5
4136+ @test ((1 : 10 )[end === 10 ? end : begin ]) === 10
4137+ @test_throws ArgumentError (let var"begin" = nothing ; (1 : 10 )[var"begin" ]; end )
4138+ @test (let a= [1 ]; a[end ]:: Int = 100 ; end ) === 100
4139+ end
4140+
41314141# Issue #56904 - lambda linearized twice
41324142@test (let ; try 3 ; finally try 1 ; f (() -> x); catch x; end ; end ; x = 7 ; end ) === 7
41334143@test (let ; try 3 ; finally try 4 ; finally try 1 ; f (() -> x); catch x; end ; end ; end ; x = 7 ; end ) === 7
You can’t perform that action at this time.
0 commit comments