@@ -33,9 +33,12 @@ function whereis(method::Method)
3333 if lin === nothing
3434 f = method_lookup_callback[]
3535 if f != = nothing
36- Base. invokelatest(f, method)
36+ try
37+ Base. invokelatest(f, method)
38+ lin = get(method_info, method. sig, nothing )
39+ catch
40+ end
3741 end
38- lin = get(method_info, method. sig, nothing )
3942 end
4043 if lin === nothing
4144 file, line = String(method. file), method. line
@@ -115,12 +118,15 @@ end
115118function signatures_at(id:: PkgId , relpath:: AbstractString , line:: Integer )
116119 expressions = expressions_callback[]
117120 expressions === nothing && error(" cannot look up methods by line number, try `using Revise` before loading other packages" )
118- for (mod, exsigs) in Base. invokelatest(expressions, id, relpath)
119- for (ex, sigs) in exsigs
120- lr = linerange(ex)
121- lr === nothing && continue
122- line ∈ lr && return sigs
121+ try
122+ for (mod, exsigs) in Base. invokelatest(expressions, id, relpath)
123+ for (ex, sigs) in exsigs
124+ lr = linerange(ex)
125+ lr === nothing && continue
126+ line ∈ lr && return sigs
127+ end
123128 end
129+ catch
124130 end
125131 return nothing
126132end
@@ -167,9 +173,12 @@ function definition(method::Method, ::Type{Expr})
167173 if def === nothing
168174 f = method_lookup_callback[]
169175 if f != = nothing
170- Base. invokelatest(f, method)
176+ try
177+ Base. invokelatest(f, method)
178+ def = get(method_info, method. sig, nothing )
179+ catch
180+ end
171181 end
172- def = get(method_info, method. sig, nothing )
173182 end
174183 return def === nothing ? nothing : copy(def[2 ])
175184end
0 commit comments