| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 assert(invariant(target, targetType != null, | 736 assert(invariant(target, targetType != null, |
| 737 message: 'Redirection target type has not been computed for ' | 737 message: 'Redirection target type has not been computed for ' |
| 738 '$target')); | 738 '$target')); |
| 739 target = target.internalEffectiveTarget; | 739 target = target.internalEffectiveTarget; |
| 740 break; | 740 break; |
| 741 } | 741 } |
| 742 | 742 |
| 743 Element nextTarget = target.immediateRedirectionTarget; | 743 Element nextTarget = target.immediateRedirectionTarget; |
| 744 if (seen.contains(nextTarget)) { | 744 if (seen.contains(nextTarget)) { |
| 745 error(node, MessageKind.CYCLIC_REDIRECTING_FACTORY); | 745 error(node, MessageKind.CYCLIC_REDIRECTING_FACTORY); |
| 746 // TODO(ahe): Don't throw, recover from error. |
| 747 throw new CompilerCancelledException(null); |
| 746 break; | 748 break; |
| 747 } | 749 } |
| 748 seen.add(target); | 750 seen.add(target); |
| 749 target = nextTarget; | 751 target = nextTarget; |
| 750 } | 752 } |
| 751 | 753 |
| 752 if (targetType == null) { | 754 if (targetType == null) { |
| 753 assert(!target.isRedirectingFactory); | 755 assert(!target.isRedirectingFactory); |
| 754 targetType = target.enclosingClass.thisType; | 756 targetType = target.enclosingClass.thisType; |
| 755 } | 757 } |
| (...skipping 4254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5010 } | 5012 } |
| 5011 | 5013 |
| 5012 /// The result for the resolution of the `assert` method. | 5014 /// The result for the resolution of the `assert` method. |
| 5013 class AssertResult implements ResolutionResult { | 5015 class AssertResult implements ResolutionResult { |
| 5014 const AssertResult(); | 5016 const AssertResult(); |
| 5015 | 5017 |
| 5016 Element get element => null; | 5018 Element get element => null; |
| 5017 | 5019 |
| 5018 String toString() => 'AssertResult()'; | 5020 String toString() => 'AssertResult()'; |
| 5019 } | 5021 } |
| OLD | NEW |