Skip to content

Commit b4c4a9b

Browse files
committed
Improve handling of kwcall definition failure
1 parent d5d1b96 commit b4c4a9b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/CodeTracking.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ function definition(::Type{String}, method::Method)
229229
p = Base.unwrap_unionall(method.sig).parameters
230230
for i = 2:length(p)
231231
T = p[i]
232+
isa(T, Core.TypeofVararg) && break # it's not our target, and there are no more arguments after this
232233
if T <: Function
233234
mstring = string(nameof(T))
234235
if startswith(mstring, '#')
@@ -237,7 +238,7 @@ function definition(::Type{String}, method::Method)
237238
end
238239
end
239240
end
240-
methodname == :kwcall && error("could not identify method name in `Core.kwcall`")
241+
methodname == :kwcall && error("could not identify method name in `Core.kwcall` (signature: $(method.sig))")
241242
end
242243
file, line = whereis(method)
243244
line == 0 && return nothing

0 commit comments

Comments
 (0)