Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: pkg/compiler/lib/src/types/flat_type_mask.dart

Issue 1631093004: dart2js cps: Bugfix in FlatTypeMask.isDisjoint. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/types/flat_type_mask.dart
diff --git a/pkg/compiler/lib/src/types/flat_type_mask.dart b/pkg/compiler/lib/src/types/flat_type_mask.dart
index 270271d1ae88de617b4665984313cbb0c8a5958c..914e6733ca5167cb3408230a254dedd7fc608e35 100644
--- a/pkg/compiler/lib/src/types/flat_type_mask.dart
+++ b/pkg/compiler/lib/src/types/flat_type_mask.dart
@@ -367,25 +367,19 @@ class FlatTypeMask implements TypeMask {
if (base == flatOther.base) return false;
if (isExact && flatOther.isExact) return true;
- // normalization guarantees that isExact === !isSubclass && !isSubtype
- if (classWorld.isSubclassOf(flatOther.base, base)) return isExact;
- if (classWorld.isSubclassOf(base, flatOther.base)) {
- return flatOther.isExact;
- }
+ if (isExact) return !flatOther.contains(base, classWorld);
+ if (flatOther.isExact) return !contains(flatOther.base, classWorld);
+
+ // Normalization guarantees that isExact === !isSubclass && !isSubtype.
+ // Both are subclass or subtype masks, so if there is a subclass
+ // relationship, they are not disjoint.
+ if (classWorld.isSubclassOf(flatOther.base, base)) return false;
+ if (classWorld.isSubclassOf(base, flatOther.base)) return false;
// Two different base classes have no common subclass unless one is a
// subclass of the other (checked above).
if (isSubclass && flatOther.isSubclass) return true;
- if (classWorld.isSubtypeOf(flatOther.base, base)) return !isSubtype;
- if (classWorld.isSubtypeOf(base, flatOther.base)) {
- return !flatOther.isSubtype;
- }
-
- // By now we know they are not subtypes of each other, so if either is
- // exact, we are done.
- if (isExact || flatOther.isExact) return true;
-
return _isDisjointHelper(this, flatOther, classWorld);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698