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

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

Issue 2613213003: Use entities in ClosedWorld interface (Closed)
Patch Set: Created 3 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 | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/types/masks.dart » ('j') | 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 80a4734ef2394d02ba8d887ec2eb80edc800dbe7..c2027e2c5099ad990b889b44a4f8139ea51662c4 100644
--- a/pkg/compiler/lib/src/types/flat_type_mask.dart
+++ b/pkg/compiler/lib/src/types/flat_type_mask.dart
@@ -521,37 +521,28 @@ class FlatTypeMask implements TypeMask {
backendClasses.nullImplementation, selector, element);
}
- // TODO(kasperl): Can't we just avoid creating typed selectors
- // based of function types?
- Element self = base;
- if (self.isTypedef) {
- // A typedef is a function type that doesn't have any
- // user-defined members.
- return false;
- }
-
- ClassElement other = element.enclosingClass;
+ ClassEntity other = element.enclosingClass.declaration;
if (other == backendClasses.nullImplementation) {
return isNullable;
} else if (isExact) {
- return closedWorld.hasElementIn(self, selector, element);
+ return closedWorld.hasElementIn(base, selector, element);
} else if (isSubclass) {
- return closedWorld.hasElementIn(self, selector, element) ||
- other.isSubclassOf(self) ||
- closedWorld.hasAnySubclassThatMixes(self, other);
+ return closedWorld.hasElementIn(base, selector, element) ||
+ closedWorld.isSubclassOf(other, base) ||
+ closedWorld.hasAnySubclassThatMixes(base, other);
} else {
assert(isSubtype);
- bool result = closedWorld.hasElementIn(self, selector, element) ||
- other.implementsInterface(self) ||
+ bool result = closedWorld.hasElementIn(base, selector, element) ||
+ closedWorld.isSubtypeOf(other, base) ||
closedWorld.hasAnySubclassThatImplements(other, base) ||
closedWorld.hasAnySubclassOfMixinUseThatImplements(other, base);
if (result) return true;
// If the class is used as a mixin, we have to check if the element
// can be hit from any of the mixin applications.
- Iterable<ClassElement> mixinUses = closedWorld.mixinUsesOf(self);
+ Iterable<ClassEntity> mixinUses = closedWorld.mixinUsesOf(base);
return mixinUses.any((mixinApplication) =>
closedWorld.hasElementIn(mixinApplication, selector, element) ||
- other.isSubclassOf(mixinApplication) ||
+ closedWorld.isSubclassOf(other, mixinApplication) ||
closedWorld.hasAnySubclassThatMixes(mixinApplication, other));
}
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/types/masks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698