diff --git a/test/parse.jl b/test/parse.jl index 39efcf354657a2..73314f8bd408d2 100644 --- a/test/parse.jl +++ b/test/parse.jl @@ -1346,3 +1346,12 @@ end x::Int -> 2 end end) == Expr(:error, "local variable Int cannot be used in closure declaration") + +# issue #23519 +@test parse("@foo[1]") == parse("@foo([1])") +@test parse("@foo[1 2; 3 4]") == parse("@foo([1 2; 3 4])") +@test parse("@foo[1] + [2]") == parse("@foo([1]) + [2]") +@test parse("@foo [1] + [2]") == parse("@foo([1] + [2])") +@test parse("@Mdl.foo[1] + [2]") == parse("@Mdl.foo([1]) + [2]") +@test parse("@Mdl.foo [1] + [2]") == parse("@Mdl.foo([1] + [2])") +