Just for fun, this even happens with totally new annotated types and no number-crunching. The Revise.includet
equivalent as stated in the post has the same outcome.
julia> begin
abstract type AbstractBlah end
struct Blah<:AbstractBlah end
foo(::Blah, ::AbstractBlah) = 1
foo(::AbstractBlah, ::Blah) = -1
test() = foo(Blah(), Blah())
end
test (generic function with 1 method)
julia> foo(Blah(), Blah())
ERROR: MethodError: foo(::Blah, ::Blah) is ambiguous.
Candidates:
foo(::AbstractBlah, ::Blah)
@ Main REPL[1]:5
foo(::Blah, ::AbstractBlah)
@ Main REPL[1]:4
Possible fix, define
foo(::Blah, ::Blah)
Stacktrace:
[1] top-level scope
@ REPL[2]:1
julia> test() # same outcome as expected from forwarding to same call
ERROR: MethodError: foo(::Blah, ::Blah) is ambiguous.
Candidates:
foo(::AbstractBlah, ::Blah)
@ Main REPL[1]:5
foo(::Blah, ::AbstractBlah)
@ Main REPL[1]:4
Possible fix, define
foo(::Blah, ::Blah)
Stacktrace:
[1] test()
@ Main .\REPL[1]:6
[2] top-level scope
@ REPL[3]:1
julia> Base.delete_method(methods(foo)[2]) # no Base methods to avoid deleting
julia> foo(Blah(), Blah()) # properly invalidated previous MethodError call
-1
julia> test()
Unreachable reached at 00000204af55136f
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ILLEGAL_INSTRUCTION at 0x204af55136f -- test at .\REPL[1]:6
in expression starting at REPL[6]:1
test at .\REPL[1]:6
unknown function (ip: 00000204af5513a4)
jl_apply at C:/workdir/src\julia.h:2157 [inlined]
...