@@ -3016,24 +3016,28 @@ function abstract_applicable(interp::AbstractInterpreter, argtypes::Vector{Any},
30163016 isvarargtype (argtypes[2 ]) && return Future (CallMeta (Bool, ArgumentError, EFFECTS_THROWS, NoCallInfo ()))
30173017 argtypes = argtypes[2 : end ]
30183018 atype = argtypes_to_type (argtypes)
3019- matches = find_method_matches (interp, argtypes, atype; max_methods)
3020- info = NoCallInfo ()
3021- if isa (matches, FailedMethodMatch)
3022- rt = Bool # too many matches to analyze
3019+ if atype === Union{}
3020+ rt = Union{} # accidentally unreachable code
30233021 else
3024- (; valid_worlds, applicable) = matches
3025- update_valid_age! (sv, valid_worlds)
3026- napplicable = length (applicable)
3027- if napplicable == 0
3028- rt = Const (false ) # never any matches
3029- elseif ! fully_covering (matches) || any_ambig (matches)
3030- # Account for the fact that we may encounter a MethodError with a non-covered or ambiguous signature.
3031- rt = Bool
3022+ matches = find_method_matches (interp, argtypes, atype; max_methods)
3023+ info = NoCallInfo ()
3024+ if isa (matches, FailedMethodMatch)
3025+ rt = Bool # too many matches to analyze
30323026 else
3033- rt = Const (true ) # has applicable matches
3034- end
3035- if rt != = Bool
3036- info = VirtualMethodMatchInfo (matches. info)
3027+ (; valid_worlds, applicable) = matches
3028+ update_valid_age! (sv, valid_worlds)
3029+ napplicable = length (applicable)
3030+ if napplicable == 0
3031+ rt = Const (false ) # never any matches
3032+ elseif ! fully_covering (matches) || any_ambig (matches)
3033+ # Account for the fact that we may encounter a MethodError with a non-covered or ambiguous signature.
3034+ rt = Bool
3035+ else
3036+ rt = Const (true ) # has applicable matches
3037+ end
3038+ if rt != = Bool
3039+ info = VirtualMethodMatchInfo (matches. info)
3040+ end
30373041 end
30383042 end
30393043 return Future (CallMeta (rt, Union{}, EFFECTS_TOTAL, info))
0 commit comments