Skip to content

Try harder to find the true path of a method #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/CodeTracking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ is the first line of the method's body.
"""
function whereis(method::Method)
lin = get(method_info, method.sig, nothing)
if lin === nothing
f = method_lookup_callback[]
if f !== nothing
Base.invokelatest(f, method)
end
lin = get(method_info, method.sig, nothing)
end
if lin === nothing
file, line = String(method.file), method.line
else
Expand Down Expand Up @@ -194,4 +201,8 @@ were loaded to define the package that defined `mod`.
"""
pkgfiles(mod::Module) = pkgfiles(PkgId(mod))

if ccall(:jl_generating_output, Cint, ()) == 1
precompile(Tuple{typeof(setindex!), Dict{PkgId,PkgFiles}, PkgFiles, PkgId})
end

end # module