| 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 1b6f35e2f752de87a56a95ce1d1d92008d07eff4..980a76fee8295e7d902319ccf5a07870e12a1ae0 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| @@ -1279,22 +1279,21 @@ 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');
|
| - }
|
| + /// 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 {
|
| + if (Elements.isErroneousElement(defaultImplementation)) {
|
| + return defaultImplementation;
|
| }
|
| - return target;
|
| + assert(!isRedirectingFactory || internalRedirectionTarget);
|
| + return isRedirectingFactory ? internalRedirectionTarget
|
| + : defaultImplementation;
|
| }
|
|
|
| InterfaceType computeTargetType(Compiler compiler,
|
|
|