| Index: pkg/compiler/lib/src/compile_time_constants.dart
|
| diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
|
| index f4f306c62d50116058c0b1b9c83b8de87fdbecaa..d633e6b1394eab126a3a3b88fffc02f70b9ce6bc 100644
|
| --- a/pkg/compiler/lib/src/compile_time_constants.dart
|
| +++ b/pkg/compiler/lib/src/compile_time_constants.dart
|
| @@ -826,19 +826,33 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
| // The redirection chain of this element may not have been resolved through
|
| // a post-process action, so we have to make sure it is done here.
|
| compiler.resolver.resolveRedirectionChain(constructor, node);
|
| - InterfaceType constructedType =
|
| - constructor.computeEffectiveTargetType(type);
|
| - ConstructorElement target = constructor.effectiveTarget;
|
| - // The constructor must be an implementation to ensure that field
|
| - // initializers are handled correctly.
|
| - ConstructorElement implementation = target.implementation;
|
| -
|
| - if (implementation.isMalformed) {
|
| - // TODO(johnniwinther): This should probably be an [ErroneousAstConstant].
|
| - return new AstConstant(context, node, new ConstructedConstantExpression(
|
| - type, constructor, callStructure, const <ConstantExpression>[]),
|
| - new ConstructedConstantValue(
|
| - constructedType, const <FieldElement, ConstantValue>{}));
|
| +
|
| + bool isInvalid = false;
|
| + InterfaceType constructedType = type;
|
| + ConstructorElement implementation;
|
| + if (constructor.isRedirectingFactory) {
|
| + if (constructor.isEffectiveTargetMalformed) {
|
| + isInvalid = true;
|
| + } else {
|
| + constructedType =
|
| + constructor.computeEffectiveTargetType(type);
|
| + ConstructorElement target = constructor.effectiveTarget;
|
| + // The constructor must be an implementation to ensure that field
|
| + // initializers are handled correctly.
|
| + implementation = target.implementation;
|
| + }
|
| + } else {
|
| + // The constructor must be an implementation to ensure that field
|
| + // initializers are handled correctly.
|
| + implementation = constructor.implementation;
|
| + isInvalid = implementation.isMalformed;
|
| + if (implementation.isGenerativeConstructor &&
|
| + constructor.enclosingClass.isAbstract) {
|
| + isInvalid = true;
|
| + }
|
| + }
|
| + if (isInvalid) {
|
| + return signalNotCompileTimeConstant(node);
|
| }
|
|
|
| List<AstConstant> concreteArguments;
|
|
|