OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.resolution.class_hierarchy; | 5 library dart2js.resolution.class_hierarchy; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart' show Feature; | 8 import '../common/resolution.dart' show Feature; |
9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
10 import '../core_types.dart' show CoreClasses, CoreTypes; | 10 import '../core_types.dart' show CoreClasses, CoreTypes; |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 MessageKind.ILLEGAL_MIXIN_CYCLE, | 437 MessageKind.ILLEGAL_MIXIN_CYCLE, |
438 {'mixinName1': current.name, 'mixinName2': previous.name}); | 438 {'mixinName1': current.name, 'mixinName2': previous.name}); |
439 // We have found a cycle in the mixin chain. Return null as | 439 // We have found a cycle in the mixin chain. Return null as |
440 // the mixin for this application to avoid getting into | 440 // the mixin for this application to avoid getting into |
441 // infinite recursion when traversing members. | 441 // infinite recursion when traversing members. |
442 return null; | 442 return null; |
443 } | 443 } |
444 previous = current; | 444 previous = current; |
445 current = currentMixinApplication.mixin; | 445 current = currentMixinApplication.mixin; |
446 } | 446 } |
447 registry.registerMixinUse(mixinApplication, mixin); | |
448 return mixinType; | 447 return mixinType; |
449 } | 448 } |
450 | 449 |
451 DartType resolveType(TypeAnnotation node) { | 450 DartType resolveType(TypeAnnotation node) { |
452 return typeResolver.resolveTypeAnnotation(this, node); | 451 return typeResolver.resolveTypeAnnotation(this, node); |
453 } | 452 } |
454 | 453 |
455 DartType resolveSupertype(ClassElement cls, TypeAnnotation superclass) { | 454 DartType resolveSupertype(ClassElement cls, TypeAnnotation superclass) { |
456 DartType supertype = resolveType(superclass); | 455 DartType supertype = resolveType(superclass); |
457 if (supertype != null) { | 456 if (supertype != null) { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 Identifier selector = node.selector.asIdentifier(); | 648 Identifier selector = node.selector.asIdentifier(); |
650 var e = prefixElement.lookupLocalMember(selector.source); | 649 var e = prefixElement.lookupLocalMember(selector.source); |
651 if (e == null || !e.impliesType) { | 650 if (e == null || !e.impliesType) { |
652 reporter.reportErrorMessage(node.selector, | 651 reporter.reportErrorMessage(node.selector, |
653 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); | 652 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); |
654 return; | 653 return; |
655 } | 654 } |
656 loadSupertype(e, node); | 655 loadSupertype(e, node); |
657 } | 656 } |
658 } | 657 } |
OLD | NEW |