diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 22c8acf4d28e0..9cf46e03a938c 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -3048,7 +3048,9 @@ f(x) = yt(x) (kill)) (cdr e))) (else - (mark-used e) + (if (eq? (car e) '=) + (visit (caddr e)) + (mark-used e)) (if (and (or (eq? (car e) '=) (and (eq? (car e) 'method) (length> e 2))) (has? unused (cadr e))) diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index b89c4feb3a437..a06f1b19601de 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -1832,6 +1832,15 @@ function g15276() end @test g15276() isa Vector{Int} +function inbounds_30563() + local y + @inbounds for i in 1:10 + y = (m->2i)(0) + end + return y +end +@test Base.return_types(inbounds_30563, ()) == Any[Int] + # issue #27316 - inference shouldn't hang on these f27316(::Vector) = nothing f27316(::Any) = f27316(Any[][1]), f27316(Any[][1])