Skip to content

Commit

Permalink
Added so JuliaLang#7714 also takes care of args... when considering a…
Browse files Browse the repository at this point in the history
… match and

removed the requirement of equal lengths of args.
  • Loading branch information
dhoegh committed Dec 27, 2014
1 parent 9d0b866 commit 939f7d1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions base/replutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down

0 comments on commit 939f7d1

Please sign in to comment.