diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index b77fdb6ed096d..973874d4a864e 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -3599,7 +3599,8 @@ f(x) = yt(x) (emit temp)))) ((&) - (assert (and value (not tail))) + (if (or (not value) tail) + (error "misplaced \"&\" expression")) `(& ,(compile (cadr e) break-labels value tail))) ((newvar) diff --git a/test/parse.jl b/test/parse.jl index 5bd36147945b4..67731babea643 100644 --- a/test/parse.jl +++ b/test/parse.jl @@ -1251,3 +1251,6 @@ end === (3, String) # issue #22868 @test_throws ParseError parse("x@time 2") @test_throws ParseError parse("@ time") + +# issue #7479 +@test expand(Main, parse("(true &&& false)")) == Expr(:error, "misplaced \"&\" expression")