| Index: dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| index 357c08ae25077b334580277a1f946c7bc6740d54..719b88b87f79a9823b8c18cd86dd74a6b3dfa481 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| @@ -1875,7 +1875,15 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
|
|
|
| visitReturn(Return node) {
|
| if (node.isRedirectingFactoryBody) {
|
| - useElement(node.expression, resolveRedirectingFactory(node));
|
| + Element redirectionTarget = resolveRedirectingFactory(node);
|
| + useElement(node.expression, redirectionTarget);
|
| + assert(invariant(node, enclosingElement.isFactoryConstructor()));
|
| + FunctionElement constructor = enclosingElement;
|
| + // TODO(ahe): Check that this doesn't lead to a cycle. For now,
|
| + // that is checked on demand when the backend requests this
|
| + // constructor and it leads to a crash.
|
| + constructor.defaultImplementation = redirectionTarget;
|
| + world.registerStaticUse(redirectionTarget);
|
| } else {
|
| visit(node.expression);
|
| }
|
|
|