Skip to content

Commit

Permalink
fixes #9001
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeInnes committed Nov 14, 2014
1 parent b923a43 commit 5c60996
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions base/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ function newmethod(funcs, f)
end

function trackmethod(def)
name = namify(unblock(def))
name = uncurly(unblock(def).args[1].args[1])
f = esc(name)
quote
if isdefined($(Expr(:quote, name))) && isgeneric($f)
if $(isexpr(name, Symbol)) && isdefined($(Expr(:quote, name))) && isgeneric($f)
funcs = [def => def.func for def in methods($f)]
$(esc(def))
$f, newmethod(funcs, $f)
Expand Down Expand Up @@ -127,6 +127,8 @@ function unblock(ex)
return exs[1]
end

uncurly(ex) = isexpr(ex, :curly) ? ex.args[1] : ex

namify(ex::Expr) = namify(ex.args[1])
namify(sy::Symbol) = sy

Expand Down

0 comments on commit 5c60996

Please sign in to comment.