| Index: lib/compiler/implementation/compile_time_constants.dart
|
| diff --git a/lib/compiler/implementation/compile_time_constants.dart b/lib/compiler/implementation/compile_time_constants.dart
|
| index d7cbf87a4afc246991dadaddaa74725ce344c33f..78e3e8ec333a81ccb3d1a0c17c0b6b9b55fbf447 100644
|
| --- a/lib/compiler/implementation/compile_time_constants.dart
|
| +++ b/lib/compiler/implementation/compile_time_constants.dart
|
| @@ -952,6 +952,12 @@ class CompileTimeConstantEvaluator extends AbstractVisitor {
|
| FunctionParameters parameters = target.computeParameters(compiler);
|
| List<Constant> arguments = <Constant>[];
|
| Selector selector = elements.getSelector(send);
|
| + // For an implicit super call we construct a synthetic send which is not
|
| + // in the elements.
|
| + if (selector == null) {
|
| + assert(send.argumentsNode.isEmpty());
|
| + selector = Selector.INVOCATION_0;
|
| + }
|
|
|
| Function compileArgument = evaluate;
|
| Function compileConstant = compiler.compileVariable;
|
| @@ -1042,11 +1048,13 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
|
| });
|
| }
|
|
|
| - void evaluateSuperOrRedirectSend(FunctionElement targetConstructor,
|
| - List<Constant> targetArguments) {
|
| + void evaluateSuperOrRedirectSend(Send send,
|
| + FunctionElement targetConstructor) {
|
| + List<Constant> arguments =
|
| + evaluateArgumentsToConstructor(send, targetConstructor);
|
| ConstructorEvaluator evaluator =
|
| new ConstructorEvaluator(targetConstructor, compiler);
|
| - evaluator.evaluateConstructorFieldValues(targetArguments);
|
| + evaluator.evaluateConstructorFieldValues(arguments);
|
| // Copy over the fieldValues from the super/redirect-constructor.
|
| evaluator.fieldValues.forEach((key, value) => fieldValues[key] = value);
|
| }
|
| @@ -1070,9 +1078,7 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
|
| // A super initializer or constructor redirection.
|
| Send call = link.head;
|
| FunctionElement targetConstructor = elements[call];
|
| - List<Constant> targetArguments =
|
| - evaluateArgumentsToConstructor(call, targetConstructor);
|
| - evaluateSuperOrRedirectSend(targetConstructor, targetArguments);
|
| + evaluateSuperOrRedirectSend(call, targetConstructor);
|
| foundSuperOrRedirect = true;
|
| } else {
|
| // A field initializer.
|
| @@ -1098,7 +1104,9 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
|
| if (targetConstructor === null) {
|
| compiler.internalError("no default constructor available");
|
| }
|
| - evaluateSuperOrRedirectSend(targetConstructor, const <Constant>[]);
|
| + NodeList emptyNodeList = new NodeList(nodes: const EmptyLink());
|
| + Send syntheticSend = new Send(null, null, emptyNodeList);
|
| + evaluateSuperOrRedirectSend(syntheticSend, targetConstructor);
|
| }
|
| }
|
| }
|
|
|