Skip to content

Commit

Permalink
fix lambda-optimize-vars! with complex assignment RHSs (#30564)
Browse files Browse the repository at this point in the history
fixes #30563

(cherry picked from commit 84a83ab)
  • Loading branch information
JeffBezanson authored and KristofferC committed Jan 11, 2019
1 parent 7bbc99a commit 0bd12d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2998,7 +2998,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)))
Expand Down
9 changes: 9 additions & 0 deletions test/compiler/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,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])
Expand Down

0 comments on commit 0bd12d0

Please sign in to comment.