diff --git a/base/replutil.jl b/base/replutil.jl index e5d96e6e1dd94b..fea206795203ef 100644 --- a/base/replutil.jl +++ b/base/replutil.jl @@ -147,23 +147,19 @@ function showerror(io::IO, e::MethodError) # Display up to three closest candidates lines = Array((IOBuffer, Int), 0) for method in methods(e.f) - n = length(e.args) - if n != length(method.sig) - continue - end buf = IOBuffer() print(buf, " $(e.f.env.name)(") - first = true right_matches = 0 - for (arg, sigtype) in Zip2{Any,Any}(e.args, method.sig) - if first - first = false - else + for (i, (arg, sigtype)) in enumerate(Zip2{Any,Any}(e.args, method.sig)) + if i != 1 print(buf, ", ") end if typeof(arg) <: sigtype right_matches += 1 print(buf, "::$(sigtype)") + elseif (Any...,) == (sigtype,) + right_matches += length(typeargs) - i + print(buf, "::$(sigtype)") else Base.with_output_color(:red, buf) do buf print(buf, "::$(sigtype)")