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

Unified Diff: pkg/kernel/lib/class_hierarchy.dart

Issue 2618393002: Insert covariance checks in strong mode. (Closed)
Patch Set: Merge 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 | « no previous file | pkg/kernel/lib/target/vm.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/class_hierarchy.dart
diff --git a/pkg/kernel/lib/class_hierarchy.dart b/pkg/kernel/lib/class_hierarchy.dart
index c5381277567803b6b1814e11d432f96a5d10a6fa..6771cc4560220bc7865d7eaea80b2189e215927f 100644
--- a/pkg/kernel/lib/class_hierarchy.dart
+++ b/pkg/kernel/lib/class_hierarchy.dart
@@ -232,6 +232,15 @@ class ClassHierarchy {
}
}
+ /// True if the program contains another class that is a subtype of given one.
+ bool hasProperSubtypes(Class class_) {
+ var info = _infoFor[class_];
+ var subtypes = info.subtypeIntervalList;
+ return !(subtypes.length == 2 &&
+ subtypes[0] == info.topDownIndex &&
+ subtypes[1] == info.topDownIndex + 1);
+ }
+
ClassHierarchy._internal(Program program, int numberOfClasses)
: classes = new List<Class>(numberOfClasses) {
// Build the class ordering based on a topological sort.
« no previous file with comments | « no previous file | pkg/kernel/lib/target/vm.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698