Skip to content

Commit 36f9140

Browse files
authored
Protect error calls from invalidation (#75)
These get called in the absence of knowledge about the second input, so protecting them with invokelatest avoids invalidation risk.
1 parent 1af0a40 commit 36f9140

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/signatures.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,13 @@ function methoddef!(@nospecialize(recurse), signatures, frame::Frame, @nospecial
480480
frame.pc = pc
481481
return pc, pc3
482482
end
483-
ismethod1(stmt) || error("expected method opening, got ", stmt)
483+
ismethod1(stmt) || Base.invokelatest(error, "expected method opening, got ", stmt)
484484
name = stmt.args[1]
485485
name = normalize_defsig(name, frame)
486486
if isa(name, Bool)
487487
error("not valid for anonymous methods")
488488
elseif name === missing
489-
error("given invalid definition: $stmt")
489+
Base.invokelatest(error, "given invalid definition: ", stmt)
490490
end
491491
name = name::Symbol
492492
while true # methods containing inner methods may need multiple trips through this loop

0 commit comments

Comments
 (0)