@@ -542,10 +542,6 @@ class JClosedWorld implements World {
542542 return false ;
543543 }
544544
545- late final ClassEntity _functionLub = getLubOfInstantiatedSubtypes (
546- commonElements.functionClass,
547- )! ;
548-
549545 /// Returns `true` if [selector] on [receiver] can hit a `call` method on a
550546 /// subclass of `Closure` using the [abstractValueDomain] .
551547 ///
@@ -559,23 +555,9 @@ class JClosedWorld implements World {
559555 ) {
560556 return selector.name == Identifiers .call &&
561557 (receiver == null ||
562- // This is logically equivalent to the former implementation using
563- // `abstractValueDomain.contains` (which wrapped `containsMask`).
564- // The switch to `abstractValueDomain.containsType` is because
565- // `contains` was generally unsound but happened to work correctly
566- // here. See https://dart-review.googlesource.com/c/sdk/+/130565
567- // for further discussion.
568- //
569- // This checks if the receiver mask contains the entire type cone
570- // originating from [_functionLub] and may therefore be unsound if
571- // the receiver mask contains only part of the type cone. (Is this
572- // possible?)
573- //
574- // TODO(fishythefish): Use `isDisjoint` or equivalent instead of
575- // `containsType` once we can ensure it's fast enough.
576558 abstractValueDomain
577- .containsType (receiver, _functionLub )
578- .isPotentiallyTrue );
559+ .areDisjoint (abstractValueDomain.functionType, receiver )
560+ .isPotentiallyFalse );
579561 }
580562
581563 /// Returns `true` if [selector] on [receiver] can hit a `call` method on a
@@ -591,9 +573,9 @@ class JClosedWorld implements World {
591573 Selector getSelector (ir.Expression node) => elementMap.getSelector (node);
592574
593575 /// Returns all the instance members that may be invoked with the [selector]
594- /// on the given [receiver] using the [abstractValueDomain] . The returned elements may include noSuchMethod
595- /// handlers that are potential targets indirectly through the noSuchMethod
596- /// mechanism.
576+ /// on the given [receiver] using the [abstractValueDomain] . The returned
577+ /// elements may include noSuchMethod handlers that are potential targets
578+ /// indirectly through the noSuchMethod mechanism.
597579 Iterable <MemberEntity > locateMembersInDomain (
598580 Selector selector,
599581 AbstractValue ? receiver,
0 commit comments