Remove unused methods
Change-Id: I782700f972b846ec0d86b671c0c9b097ca73495d
Reviewed-on: https://dart-review.googlesource.com/c/88800
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
diff --git a/pkg/kernel/lib/class_hierarchy.dart b/pkg/kernel/lib/class_hierarchy.dart
index 1a7de5c..9fa31ec 100644
--- a/pkg/kernel/lib/class_hierarchy.dart
+++ b/pkg/kernel/lib/class_hierarchy.dart
@@ -39,9 +39,6 @@
/// [unordered], they are not included.
Iterable<Class> getOrderedClasses(Iterable<Class> unordered);
- /// True if the component contains another class that is a subtype of given one.
- bool hasProperSubtypes(Class class_);
-
// Returns the instantition of each generic supertype implemented by this
// class (e.g. getClassAsInstanceOf applied to all superclasses and
// interfaces).
@@ -697,14 +694,6 @@
}
@override
- bool hasProperSubtypes(Class class_) {
- _ClassInfo info = _infoFor[class_];
- return info.directExtenders.isNotEmpty ||
- info.directImplementers.isNotEmpty ||
- info.directMixers.isNotEmpty;
- }
-
- @override
List<Supertype> genericSupertypesOf(Class class_) {
final supertypes = _infoFor[class_].genericSuperTypes;
if (supertypes == null) return const <Supertype>[];
diff --git a/pkg/kernel/lib/type_environment.dart b/pkg/kernel/lib/type_environment.dart
index d0603b8..fe0a51b 100644
--- a/pkg/kernel/lib/type_environment.dart
+++ b/pkg/kernel/lib/type_environment.dart
@@ -143,21 +143,6 @@
if (type1 == doubleType || type2 == doubleType) return doubleType;
return numType;
}
-
- /// Returns true if [class_] has no proper subtypes that are usable as type
- /// argument.
- bool isSealedClass(Class class_) {
- // The sealed core classes have subtypes in the patched SDK, but those
- // classes cannot occur as type argument.
- if (class_ == coreTypes.intClass ||
- class_ == coreTypes.doubleClass ||
- class_ == coreTypes.stringClass ||
- class_ == coreTypes.boolClass ||
- class_ == coreTypes.nullClass) {
- return true;
- }
- return !hierarchy.hasProperSubtypes(class_);
- }
}
/// The part of [TypeEnvironment] that deals with subtype tests.
diff --git a/pkg/kernel/test/class_hierarchy_bench.dart b/pkg/kernel/test/class_hierarchy_bench.dart
index cab6148..92ef9cf 100644
--- a/pkg/kernel/test/class_hierarchy_bench.dart
+++ b/pkg/kernel/test/class_hierarchy_bench.dart
@@ -68,15 +68,6 @@
return hierarchies[currentHierarchy];
}
- {
- var classHierarchy = getClassHierarchy();
- if (classHierarchy is ClosedWorldClassHierarchy) {
- for (Class class_ in classes) {
- classHierarchy.hasProperSubtypes(class_);
- }
- }
- }
-
Random rnd = new Random(12345);
const int numQueryTrials = 100000;
diff --git a/pkg/kernel/test/class_hierarchy_test.dart b/pkg/kernel/test/class_hierarchy_test.dart
index 28b6038..956c0cf 100644
--- a/pkg/kernel/test/class_hierarchy_test.dart
+++ b/pkg/kernel/test/class_hierarchy_test.dart
@@ -45,7 +45,6 @@
// No updated classes, the same hierarchy.
expect(hierarchy.applyTreeChanges([], []), same(hierarchy));
- expect(hierarchy.hasProperSubtypes(a), true);
// Has updated classes, still the same hierarchy (instance). Can answer
// queries about the new classes.
@@ -59,11 +58,9 @@
expect(hierarchy.applyTreeChanges([libWithB], [libWithC]), same(hierarchy));
expect(hierarchy.isSubclassOf(a, c), false);
expect(hierarchy.isSubclassOf(c, a), true);
- expect(hierarchy.hasProperSubtypes(a), true);
// Remove so A should no longer be a super of anything.
expect(hierarchy.applyTreeChanges([libWithC], []), same(hierarchy));
- expect(hierarchy.hasProperSubtypes(a), false);
}
void test_applyMemberChanges() {