diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 49ba2fe728789..4a0407e019432 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -4404,6 +4404,9 @@ f(x) = yt(x) cnd))) (define (emit-cond cnd break-labels endl) (let* ((cnd (if (and (pair? cnd) (eq? (car cnd) 'block)) + (flatten-ex 'block cnd) + cnd)) + (cnd (if (and (pair? cnd) (eq? (car cnd) 'block)) (begin (if (length> cnd 2) (compile (butlast cnd) break-labels #f #f)) (last cnd)) cnd)) diff --git a/test/syntax.jl b/test/syntax.jl index 71c051040967c..cff8628290081 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -3422,3 +3422,10 @@ end # issue #46251 @test begin; global value = 1; (value, value += 1) end == (1, 2) @test begin; global value = 1; "($(value), $(value += 1))" end == "(1, 2)" + +# issue #47410 +# note `eval` is needed since this needs to be at the top level +@test eval(:(if false + elseif false || (()->true)() + 42 + end)) == 42