Fix some about fn bugs
This commit is contained in:
parent
08f4b58c1a
commit
5492e6954a
|
@ -162,7 +162,7 @@ function memorylayout(val::T) where {T}
|
|||
end
|
||||
|
||||
function about(fn::Function)
|
||||
source = Main.InteractiveUtils.which(Main, Symbol(fn))
|
||||
source = Main.InteractiveUtils.which(parentmodule(fn), Symbol(fn))
|
||||
methodmodules = getproperty.(methods(fn).ms, :module)
|
||||
others = setdiff(methodmodules, [source])
|
||||
print(Base.summary(fn))
|
||||
|
@ -238,7 +238,7 @@ macro about(obj::Symbol, types::Union{Symbol, Expr}...)
|
|||
types[1] == :(())
|
||||
:(about($obj, Tuple{}))
|
||||
elseif Core.eval(Main, obj) isa Function && length(types) > 0
|
||||
:(about($obj, $(Tuple{Core.eval.(Main, types)...})))
|
||||
:(about($obj, $(Tuple{Core.eval.(Ref(Main), types)...})))
|
||||
else
|
||||
:(about($obj))
|
||||
end |> esc
|
||||
|
@ -249,7 +249,7 @@ macro about(qobj::Union{QuoteNode, Expr}, types::Union{Symbol, Expr}...)
|
|||
types[1] == :(())
|
||||
:(about($(Core.eval(Main, qobj)), Tuple{}))
|
||||
elseif length(types) > 0
|
||||
:(about($(Core.eval(Main, qobj)), $(Tuple{Core.eval.(Main, types)...})))
|
||||
:(about($(Core.eval(Main, qobj)), $(Tuple{Core.eval.(Ref(Main), types)...})))
|
||||
else
|
||||
:(about($(Core.eval(Main, qobj))))
|
||||
end |> esc
|
||||
|
|
Loading…
Reference in New Issue