@@ -2223,11 +2223,12 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
22232223 if isa (method_or_ci, CodeInstance)
22242224 our_world = sv. world. this
22252225 argtype = argtypes_to_type (pushfirst! (argtype_tail (argtypes, 4 ), ft))
2226- sig = method_or_ci. def. specTypes
2226+ specsig = method_or_ci. def. specTypes
2227+ defdef = method_or_ci. def. def
22272228 exct = method_or_ci. exctype
2228- if ! hasintersect (argtype, sig )
2229+ if ! hasintersect (argtype, specsig )
22292230 return Future (CallMeta (Bottom, TypeError, EFFECTS_THROWS, NoCallInfo ()))
2230- elseif ! (argtype <: sig )
2231+ elseif ! (argtype <: specsig ) || ( isa (defdef, Method) && ! (argtype <: defdef. sig) )
22312232 exct = Union{exct, TypeError}
22322233 end
22332234 callee_valid_range = WorldRange (method_or_ci. min_world, method_or_ci. max_world)
@@ -2257,7 +2258,7 @@ function abstract_invoke(interp::AbstractInterpreter, arginfo::ArgInfo, si::Stmt
22572258 # Fall through to generic invoke handling
22582259 end
22592260 else
2260- widenconst (types) >: Union{Method, CodeInstance} && return Future (CallMeta (Any, Any, Effects (), NoCallInfo ()))
2261+ hasintersect ( widenconst (types), Union{Method, CodeInstance}) && return Future (CallMeta (Any, Any, Effects (), NoCallInfo ()))
22612262 (types, isexact, isconcrete, istype) = instanceof_tfunc (argtype_by_index (argtypes, 3 ), false )
22622263 isexact || return Future (CallMeta (Any, Any, Effects (), NoCallInfo ()))
22632264 unwrapped = unwrap_unionall (types)
0 commit comments