File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -8,18 +8,17 @@ _isgensym(s::Symbol) = occursin("#", string(s))
88@generated function (fc:: FunctionConstructor{F} )(args... ) where F
99 isempty(args) && return Expr(:new, F)
1010
11- T = getfield(parentmodule(F), nameof(F))
1211 # We assume all gensym names are anonymous functions
13- _isgensym(nameof(F)) || return :($ T (args... ))
12+ _isgensym(nameof(F)) || return :($ F (args... ))
1413 # Define `new` for rebuilt function type that matches args
15- exp = Expr(:new, Expr(:curly, T , args... ))
14+ exp = Expr(:new, Expr(:curly, F , args... ))
1615 for i in 1 : length(args)
1716 push!(exp. args, :(args[$ i]))
1817 end
1918 return exp
2019end
2120
2221function ConstructionBase. constructorof(f:: Type{F} ) where F <: Function
23- FunctionConstructor{F }()
22+ FunctionConstructor{Base . typename(F) . wrapper }()
2423end
2524
You can’t perform that action at this time.
0 commit comments