-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
error messagesBetter, more actionable error messagesBetter, more actionable error messages
Description
In 1.10,
julia> f(x::Int) = x
f (generic function with 1 method)
julia> f(1.0)
ERROR: MethodError: no method matching f(::Float64)
Closest candidates are:
f(::Int64)
@ Main REPL[1]:1
Stacktrace:
[1] top-level scope
@ REPL[2]:1Whereas in 1.11.0-alpha1 (after #47369), we have
julia> f(x::Int) = x
f (generic function with 1 method)
julia> f(1.0)
ERROR: MethodError: no method matching f(::Float64)
The function `f` exists, but no method is defined for this combination of argument types.
Closest candidates are:
f(::Int64)
@ Main REPL[1]:1
Stacktrace:
[1] top-level scope
@ REPL[2]:1The error message already displays function signatures that do exist and already says that no method matches the argument types (by providing the argument types). The hint has a lower information density and provides not additional information or explanation that was previously lacking. I do not think it is worth deferring the method signatures and stacktrace by one line to display this hint.
Most of #47369 is great, but I think some or all of the extra hints should be reverted.
jariji and mikmoore
Metadata
Metadata
Assignees
Labels
error messagesBetter, more actionable error messagesBetter, more actionable error messages