You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionget_f()
f1(x) =2x
functionf2()
b =f1(2)
return b
endreturn f2
end
f =get_f()
@code_warntypef()
I get
Variables:
b::Any
Body:
begin # C:\Users\anthoff\source\4sD.jl\test2.jl, line 5:
b = f1(2)::Any # C:\Users\anthoff\source\4sD.jl\test2.jl, line 7:
return b
end::Any
Could type inference work better here, i.e. type b properly?
I'm not sure how to title this issue, please adjust if this issue makes sense.
The text was updated successfully, but these errors were encountered:
Not sure what's causing this on 0.4 but on 0.5 this is caused by #15276 on 0.5. I'm going to close this as a dup of #15276 since it's unlikely we'll change anything about this on 0.4.
julia>functionget_f()
f1 = (x) ->2x
f2 =function()
b =f1(2)
return b
endreturn f2
end
get_f (generic function with 1 method)
julia>@code_warntypeget_f()
Variables:#self#::#get_f
f1::Core.Box#1::##1#3
f2::##2#4#2::##2#4
Body:begin# REPL[0], line 2:
f1::Core.Box=$(Expr(:new, :((top(getfield))(Core,:Box)::Type{Core.Box})))
#1::##1#3 = $(Expr(:new, :(Main.##1#3)))GenSym(0) =#1::##1#3
(top(setfield!))(f1::Core.Box,:contents,GenSym(0))::##1#3 # REPL[0], line 4:#2::##2#4 = $(Expr(:new, :(Main.##2#4), :(f1::Core.Box)))
f2::##2#4 = #2::##2#4 # REPL[0], line 10:return f2::##2#4end::##2#4
This is on julia 0.4.5 on Windows:
I get
Could type inference work better here, i.e. type b properly?
I'm not sure how to title this issue, please adjust if this issue makes sense.
The text was updated successfully, but these errors were encountered: