Chromium Code Reviews| Index: lib/compiler/implementation/universe/universe.dart |
| =================================================================== |
| --- lib/compiler/implementation/universe/universe.dart (revision 14186) |
| +++ lib/compiler/implementation/universe/universe.dart (working copy) |
| @@ -526,7 +526,21 @@ |
| } |
| ClassElement self = receiverType.element; |
| - if (other.implementsInterface(self) || other.isSubclassOf(self)) { |
| + |
| + // Checks if a subclass of [superClass] implements [self]. If one |
| + // is found, [element] is a candidate. |
| + bool hasOneSubclassThatImplements(ClassElement superClass) { |
|
ahe
2012/10/29 13:15:21
superclass is one word.
ngeoffray
2012/10/29 13:35:18
Done.
|
| + // [TypedSelector] are only used when compiling. |
| + assert(compiler.phase == Compiler.PHASE_COMPILING); |
| + Set<ClassElement> typesImplementedBySubclasses = |
| + compiler.world.typesImplementedBySubclasses[superClass]; |
|
ahe
2012/10/29 13:15:21
I'm concerned by the direct use of maps. Could you
ngeoffray
2012/10/29 13:35:18
Done.
|
| + if (typesImplementedBySubclasses == null) return false; |
| + return typesImplementedBySubclasses.contains(receiverType); |
| + } |
| + |
| + if (other.implementsInterface(self) |
| + || other.isSubclassOf(self) |
| + || hasOneSubclassThatImplements(other)) { |
| return appliesUntyped(element, compiler); |
| } |