Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| index fda82a7406b554fd4bb58c354a211b9125d355f5..6f863955307fdc151c5db7824809c726c89a373a 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| @@ -1275,22 +1275,15 @@ class FunctionElementX extends ElementX implements FunctionElement { |
| bool get isRedirectingFactory => defaultImplementation != this; |
| - FunctionElement get redirectionTarget { |
| - if (this == defaultImplementation) return this; |
| - var target = defaultImplementation; |
| - Set<Element> seen = new Set<Element>(); |
| - seen.add(target); |
| - while (!target.isErroneous() && target != target.defaultImplementation) { |
| - target = target.defaultImplementation; |
| - if (seen.contains(target)) { |
| - // TODO(ahe): This is expedient for now, but it should be |
| - // checked by the resolver. Keeping http://dartbug.com/3970 |
| - // open to track this. |
| - throw new SpannableAssertionFailure( |
| - target, 'redirecting factory leads to cycle'); |
| - } |
| - } |
| - return target; |
| + /// This field is set by the post process queue when checking for cycles. |
| + FunctionElement internalRedirectionTarget; |
| + set redirectionTarget(FunctionElement constructor) { |
| + assert(constructor != null && internalRedirectionTarget == null); |
| + internalRedirectionTarget = constructor; |
| + } |
| + get redirectionTarget { |
| + return internalRedirectionTarget != null ? internalRedirectionTarget |
| + : defaultImplementation; |
|
ngeoffray
2013/09/18 11:19:23
This looks weird. Depending on the current stage o
karlklose
2013/09/18 12:30:39
Actually I can decide which of them to return inde
|
| } |
| InterfaceType computeTargetType(Compiler compiler, |