-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in type inference in closures #16048
Comments
Dup of #15276 |
Is this a dup? My problem has no arrays or comprehensions in it at all. Even if this has the same root cause, isn't this a much simpler repo than #15276? |
It is a dup. Both of them are caused by closure lowering. It is very easy to construct simple repros and there's no reason to keep multiple issue around for exactly the same issue. julia> function f()
a = 2
(()->a)()
end
f (generic function with 1 method)
julia> @code_warntype f()
Variables:
#self#::#f
a::Core.Box
#1::##1#2
Body:
begin # REPL[1], line 2:
a::Core.Box = $(Expr(:new, :((top(getfield))(Core,:Box)::Type{Core.Box})))
(top(setfield!))(a::Core.Box,:contents,2)::Int64 # REPL[1], line 3:
GenSym(0) = a::Core.Box
return (top(getfield))(GenSym(0),:contents)::Any
end::Any |
Alright, thanks for looking into it! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the repo code:
On julia 0.4 I get:
On julia 0.5 I get:
The text was updated successfully, but these errors were encountered: