Skip to content

Commit

Permalink
fix bugs in show_method_candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Jan 18, 2018
1 parent 92a0d31 commit 5e70d05
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/replutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ function show_method_candidates(io::IO, ex::MethodError, @nospecialize kwargs=()
end
end

for (func,arg_types_param) in funcs
for (func, arg_types_param) in funcs
for method in methods(func)
buf = IOBuffer()
iob = IOContext(buf, io)
Expand All @@ -491,9 +491,9 @@ function show_method_candidates(io::IO, ex::MethodError, @nospecialize kwargs=()
s1 = sig0.parameters[1]
sig = sig0.parameters[2:end]
print(iob, " ")
if !isa(func, s1)
if !isa(func, rewrap_unionall(s1, method.sig))
# function itself doesn't match
return
continue
else
# TODO: use the methodshow logic here
use_constructor_syntax = isa(func, Type)
Expand Down Expand Up @@ -536,7 +536,7 @@ function show_method_candidates(io::IO, ex::MethodError, @nospecialize kwargs=()
print(iob, "::$sigstr")
end
end
special && right_matches==0 && return # continue the do-block
special && right_matches == 0 && continue

if length(t_i) > length(sig) && !isempty(sig) && Base.isvarargtype(sig[end])
# It ensures that methods like f(a::AbstractString...) gets the correct
Expand Down

0 comments on commit 5e70d05

Please sign in to comment.