-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Unhygienic inlining #8978
Comments
The following AST partially illustrates the issue: julia> h(;f=2) = cd() do
g()+f
end
h (generic function with 1 method)
julia> code_typed(h,())
1-element Array{Any,1}:
:($(Expr(:lambda, Any[], Any[Any[],Any[],Any[]], :(begin $(Expr(:line, 1, :none, symbol("")))
return __h#6__(2)
end))))
julia> code_typed(eval(symbol("__h#6__")),(Int,))
1-element Array{Any,1}:
:($(Expr(:lambda, Any[:f], Any[Any[:_var0],Any[Any[:f,Int64,1],Any[:_var0,Function,18]],Any[]], :(begin $(Expr(:line, 1, :none, :h))
_var0 = AST(:($(Expr(:lambda, Any[], Any[Any[],Any[],Any[Any[:f,Int64,1]]], :(begin # none, line 2:
return g() + f
end)))))
return cd(_var0::F,getindex(ENV,"HOME")::Union(ASCIIString,UTF8String))
end)))) The AST assigned to @JeffBezanson do you want this fixed in the flisp code-lowering logic (to include captured variables in the edit: code to reproduce just needed a for loop to force compilation: julia> y = 1
julia> g() = f(y)
julia> f(x) = 2
julia> f(x::Int) = 3.0
julia> h(;f=4) = cd() do
for i = 1:1
g()+f
end
end
h (generic function with 1 method)
julia> h()
ERROR: `call` has no method matching call(::Int64, ::Int64)
in anonymous at none:3
in cd at ./file.jl:20
in h at none:1 |
thanks @vtjnash for the reduced test case
On d94b0be the build failds due to the
delimter^n
expression on this line, with an error due to a boolean being used as a function.Renaming the
repeat
parameter (which should obviously have no effect) fixes the issue.Since
^
callsrepeat
directly I suspect the issue lies in the inlining.The text was updated successfully, but these errors were encountered: