Chromium Code Reviews| Index: pkg/kernel/lib/class_hierarchy.dart |
| diff --git a/pkg/kernel/lib/class_hierarchy.dart b/pkg/kernel/lib/class_hierarchy.dart |
| index 34bf1277580f7850ec2fec6bacaf9d30a210d904..7fddd6394f152a6e5fa71629c876040e33e677bc 100644 |
| --- a/pkg/kernel/lib/class_hierarchy.dart |
| +++ b/pkg/kernel/lib/class_hierarchy.dart |
| @@ -16,12 +16,14 @@ abstract class ClassHierarchy { |
| factory ClassHierarchy(Program program) => |
| new ClosedWorldClassHierarchy(program); |
| - /// All classes in the program. |
| + /// Given the [unordered] classes, return them in such order that classes |
| + /// occur after their super classes. |
| /// |
| - /// The iterable is ordered so that classes occur after their super classes. |
| - Iterable<Class> get classes; |
| + /// If [unordered] does not include all superclasses, they might still be |
| + /// returned, it is up to the client to filter them out if required. |
| + Iterable<Class> getOrderedClasses(Iterable<Class> unordered); |
| - /// Returns the index of [class_] in the [classes] list. |
| + /// Returns the unique index of the [class_]. |
| int getClassIndex(Class class_); |
| /// True if the program contains another class that is a subtype of given one. |
| @@ -137,6 +139,9 @@ class ClosedWorldClassHierarchy implements ClassHierarchy { |
| @override |
| int getClassIndex(Class class_) => _infoFor[class_].topologicalIndex; |
| + @override |
| + Iterable<Class> getOrderedClasses(Iterable<Class> unordered) => classes; |
|
Siggi Cherem (dart-lang)
2017/06/06 00:15:21
mmm - It seems a bit surprising if you pass 2 clas
scheglov
2017/06/06 01:33:27
I updated `getOrderedClasses` to perform filtering
Siggi Cherem (dart-lang)
2017/06/06 03:03:44
sorry, makes sense, I forgot that IncrementalCla
|
| + |
| /// True if [subclass] inherits from [superclass] though zero or more |
| /// `extends` relationships. |
| bool isSubclassOf(Class subclass, Class superclass) { |