We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72bb19d commit e54ec7fCopy full SHA for e54ec7f
src/functions.jl
@@ -8,11 +8,10 @@ _isgensym(s::Symbol) = occursin("#", string(s))
8
@generated function (fc::FunctionConstructor{F})(args...) where F
9
isempty(args) && return Expr(:new, F)
10
11
- T = getfield(parentmodule(F), nameof(F))
12
# We assume all gensym names are anonymous functions
13
- _isgensym(nameof(F)) || return :($T(args...))
+ _isgensym(nameof(F)) || return :($F(args...))
14
# Define `new` for rebuilt function type that matches args
15
- exp = Expr(:new, Expr(:curly, T, args...))
+ exp = Expr(:new, Expr(:curly, F, args...))
16
for i in 1:length(args)
17
push!(exp.args, :(args[$i]))
18
end
0 commit comments