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

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

Issue 2366363002: Move remaining functionality from ClassWorld to ClosedWorld (Closed)
Patch Set: Created 4 years, 3 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
Index: pkg/compiler/lib/src/types/dictionary_type_mask.dart
diff --git a/pkg/compiler/lib/src/types/dictionary_type_mask.dart b/pkg/compiler/lib/src/types/dictionary_type_mask.dart
index c3080419c5afddcc1be169099c801d0b573c83e6..fc7a8a593f0bb778e91194e8f832649934f9d153 100644
--- a/pkg/compiler/lib/src/types/dictionary_type_mask.dart
+++ b/pkg/compiler/lib/src/types/dictionary_type_mask.dart
@@ -47,13 +47,13 @@ class DictionaryTypeMask extends MapTypeMask {
(k) => typeMap.containsKey(k) && typeMap[k] == other.typeMap[k]);
}
- TypeMask intersection(TypeMask other, ClassWorld classWorld) {
- TypeMask forwardIntersection = forwardTo.intersection(other, classWorld);
+ TypeMask intersection(TypeMask other, ClosedWorld closedWorld) {
+ TypeMask forwardIntersection = forwardTo.intersection(other, closedWorld);
if (forwardIntersection.isEmptyOrNull) return forwardIntersection;
return forwardIntersection.isNullable ? nullable() : nonNullable();
}
- TypeMask union(other, ClassWorld classWorld) {
+ TypeMask union(other, ClosedWorld closedWorld) {
if (this == other) {
return this;
} else if (equalsDisregardNull(other)) {
@@ -61,9 +61,9 @@ class DictionaryTypeMask extends MapTypeMask {
} else if (other.isEmptyOrNull) {
return other.isNullable ? this.nullable() : this;
} else if (other.isDictionary) {
- TypeMask newForwardTo = forwardTo.union(other.forwardTo, classWorld);
- TypeMask newKeyType = keyType.union(other.keyType, classWorld);
- TypeMask newValueType = valueType.union(other.valueType, classWorld);
+ TypeMask newForwardTo = forwardTo.union(other.forwardTo, closedWorld);
+ TypeMask newKeyType = keyType.union(other.keyType, closedWorld);
+ TypeMask newValueType = valueType.union(other.valueType, closedWorld);
Map<String, TypeMask> mappings = <String, TypeMask>{};
typeMap.forEach((k, v) {
if (!other.typeMap.containsKey(k)) {
@@ -72,7 +72,7 @@ class DictionaryTypeMask extends MapTypeMask {
});
other.typeMap.forEach((k, v) {
if (typeMap.containsKey(k)) {
- mappings[k] = v.union(typeMap[k], classWorld);
+ mappings[k] = v.union(typeMap[k], closedWorld);
} else {
mappings[k] = v.nullable();
}
@@ -82,13 +82,13 @@ class DictionaryTypeMask extends MapTypeMask {
} else if (other.isMap &&
(other.keyType != null) &&
(other.valueType != null)) {
- TypeMask newForwardTo = forwardTo.union(other.forwardTo, classWorld);
- TypeMask newKeyType = keyType.union(other.keyType, classWorld);
- TypeMask newValueType = valueType.union(other.valueType, classWorld);
+ TypeMask newForwardTo = forwardTo.union(other.forwardTo, closedWorld);
+ TypeMask newKeyType = keyType.union(other.keyType, closedWorld);
+ TypeMask newValueType = valueType.union(other.valueType, closedWorld);
return new MapTypeMask(
newForwardTo, null, null, newKeyType, newValueType);
} else {
- return forwardTo.union(other, classWorld);
+ return forwardTo.union(other, closedWorld);
}
}

Powered by Google App Engine
This is Rietveld 408576698