OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of types; | 5 part of types; |
6 | 6 |
7 /** | 7 /** |
8 * A flat type mask is a type mask that has been flattened to contain a | 8 * A flat type mask is a type mask that has been flattened to contain a |
9 * base type. | 9 * base type. |
10 */ | 10 */ |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 || classWorld.hasAnySubclassThatMixes(mixinApplication, other)); | 539 || classWorld.hasAnySubclassThatMixes(mixinApplication, other)); |
540 } | 540 } |
541 } | 541 } |
542 | 542 |
543 /** | 543 /** |
544 * Returns whether a [selector] call on an instance of [cls] | 544 * Returns whether a [selector] call on an instance of [cls] |
545 * will hit a method at runtime, and not go through [noSuchMethod]. | 545 * will hit a method at runtime, and not go through [noSuchMethod]. |
546 */ | 546 */ |
547 static bool hasConcreteMatch(ClassElement cls, | 547 static bool hasConcreteMatch(ClassElement cls, |
548 Selector selector, | 548 Selector selector, |
549 ClassWorld world) { | 549 World world) { |
550 assert(invariant(cls, world.isInstantiated(cls), | 550 assert(invariant(cls, |
| 551 world.compiler.resolverWorld.isInstantiated(cls), |
551 message: '$cls has not been instantiated.')); | 552 message: '$cls has not been instantiated.')); |
552 Element element = findMatchIn(cls, selector); | 553 Element element = findMatchIn(cls, selector); |
553 if (element == null) return false; | 554 if (element == null) return false; |
554 | 555 |
555 if (element.isAbstract) { | 556 if (element.isAbstract) { |
556 ClassElement enclosingClass = element.enclosingClass; | 557 ClassElement enclosingClass = element.enclosingClass; |
557 return hasConcreteMatch(enclosingClass.superclass, selector, world); | 558 return hasConcreteMatch(enclosingClass.superclass, selector, world); |
558 } | 559 } |
559 return selector.appliesUntyped(element, world); | 560 return selector.appliesUntyped(element, world); |
560 } | 561 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 if (x.isExact) { | 704 if (x.isExact) { |
704 return null; | 705 return null; |
705 } else if (x.isSubclass) { | 706 } else if (x.isSubclass) { |
706 return classWorld.strictSubclassesOf(element); | 707 return classWorld.strictSubclassesOf(element); |
707 } else { | 708 } else { |
708 assert(x.isSubtype); | 709 assert(x.isSubtype); |
709 return classWorld.strictSubtypesOf(element); | 710 return classWorld.strictSubtypesOf(element); |
710 } | 711 } |
711 } | 712 } |
712 } | 713 } |
OLD | NEW |