| Index: sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
|
| index af97966c71e4d4fc0f784ae620b777ff1fe48c06..0008dd5dbf6f1521df87c8ec9be9f483fdf58bda 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
|
| @@ -979,6 +979,15 @@ class SimpleTypeInferrerVisitor<T>
|
| analyzeSuperConstructorCall(element, arguments);
|
| }
|
| }
|
| + // If we are looking at a new expression on a forwarding factory,
|
| + // we have to forward the call to the effective target of the
|
| + // factory.
|
| + if (element.isFactoryConstructor) {
|
| + ConstructorElement constructor = element;
|
| + if (constructor.isRedirectingFactory) {
|
| + element = constructor.effectiveTarget.implementation;
|
| + }
|
| + }
|
| if (element.isForeign(compiler.backend)) {
|
| return handleForeignSend(node);
|
| }
|
| @@ -1115,6 +1124,8 @@ class SimpleTypeInferrerVisitor<T>
|
| Selector selector,
|
| Element element,
|
| ArgumentsTypes arguments) {
|
| + assert(!element.isFactoryConstructor ||
|
| + !(element as ConstructorElement).isRedirectingFactory);
|
| // Erroneous elements may be unresolved, for example missing getters.
|
| if (Elements.isUnresolved(element)) return types.dynamicType;
|
| // TODO(herhut): should we follow redirecting constructors here? We would
|
|
|