We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b923a43 commit 5c60996Copy full SHA for 5c60996
base/docs.jl
@@ -56,10 +56,10 @@ function newmethod(funcs, f)
56
end
57
58
function trackmethod(def)
59
- name = namify(unblock(def))
+ name = uncurly(unblock(def).args[1].args[1])
60
f = esc(name)
61
quote
62
- if isdefined($(Expr(:quote, name))) && isgeneric($f)
+ if $(isexpr(name, Symbol)) && isdefined($(Expr(:quote, name))) && isgeneric($f)
63
funcs = [def => def.func for def in methods($f)]
64
$(esc(def))
65
$f, newmethod(funcs, $f)
@@ -127,6 +127,8 @@ function unblock(ex)
127
return exs[1]
128
129
130
+uncurly(ex) = isexpr(ex, :curly) ? ex.args[1] : ex
131
+
132
namify(ex::Expr) = namify(ex.args[1])
133
namify(sy::Symbol) = sy
134
0 commit comments