From 5e70d055cae782f615b5e96c5db90691e5076414 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 9 Jan 2018 23:02:02 -0500 Subject: [PATCH] fix bugs in show_method_candidates --- base/replutil.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/replutil.jl b/base/replutil.jl index a8446363c4cd3..a4e55aab981e7 100644 --- a/base/replutil.jl +++ b/base/replutil.jl @@ -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) @@ -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) @@ -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