julia
julia copied to clipboard
Misleading "This error has been manually thrown, [...]" hint
On 1.11.1, in connection with keyword arguments one can encounter misleading/wrong
This error has been manually thrown, explicitly, so the method may exist but be intentionally marked as unimplemented.
Here is a simple example:
julia> f(x::Int, y; z = 0) = 0
f (generic function with 1 method)
julia> f(x::Int, y::Int) = 0
f (generic function with 2 methods)
julia> f(x::Float64, y; z = 0) = 0
f (generic function with 3 methods)
julia> f(1, 1; zz = 0)
ERROR: MethodError: no method matching f(::Int64, ::Int64; zz::Int64)
This error has been manually thrown, explicitly, so the method may exist but be intentionally marked as unimplemented.
Closest candidates are:
f(::Int64, ::Int64) got unsupported keyword argument "zz"
@ Main REPL[2]:1
f(::Int64, ::Any; z) got unsupported keyword argument "zz"
@ Main REPL[1]:1
f(::Float64, ::Any; z) got unsupported keyword argument "zz"
@ Main REPL[3]:1
Stacktrace:
[1] kwerr(::@NamedTuple{zz::Int64}, ::Function, ::Int64, ::Int64)
@ Base ./error.jl:165
This is not an issue in 1.12:
...
julia> f(1, 1; zz = 0)
ERROR: MethodError: no method matching f(::Int64, ::Int64; zz::Int64)
This method does not support all of the given keyword arguments (and may not support any).
While the above example does not issue the same error in 1.12 (and gives a meaningful error now), I still do see it in Omniscape.jl, and I wonder what is causing it since the method clearly seems to exist and did not fail in 1.11.
https://github.com/Circuitscape/Omniscape.jl/issues/160
https://github.com/Circuitscape/Omniscape.jl/actions/runs/19689839698/job/56403154323
Is there a specific question for triage to consider here?