-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing MethodError message #228
Comments
Well, the method you mentioned throws a SpecialFunctions.jl/src/gamma.jl Lines 526 to 531 in fc960c6
The case of the julia> using Measurements, SpecialFunctions
julia> @uncertain zeta(2.0 ± 0.1)
1.645 ± 0.094 |
Indeed... Maybe it should throw an ArgumentError instead, with an informative message? Or maybe it's an issue with MethodError itself (discussion on Discourse). |
The confusing MethodError was fixed by #347. Instead of throwing a MethodError manually now julia> using Measurements, SpecialFunctions
julia> zeta(2.0 ± 0.1)
ERROR: MethodError: no method matching _zeta(::Measurement{Float64})
Closest candidates are:
_zeta(::Union{Float64, ComplexF64}) at /home/david/.julia/packages/SpecialFunctions/5CocL/src/gamma.jl:414
_zeta(::T, ::T) where T<:Union{Float64, ComplexF64} at /home/david/.julia/packages/SpecialFunctions/5CocL/src/gamma.jl:233
_zeta(::BigFloat) at /home/david/.julia/packages/SpecialFunctions/5CocL/src/gamma.jl:473
...
Stacktrace:
[1] zeta(s::Measurement{Float64})
@ SpecialFunctions ~/.julia/packages/SpecialFunctions/5CocL/src/gamma.jl:412
[2] top-level scope
@ REPL[4]:1 |
Indeed that fixes it, thanks! |
The error shown by
zeta
for unsupported number types is confusing:It's confusing since there is a candidate
zeta(::Number)
andThe text was updated successfully, but these errors were encountered: