| Index: pkg/analyzer/lib/src/generated/resolver.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
|
| index 13921b7f44803e5a8da3f92ea8fd5f1d60d15f33..7e3842643a6c2b010b15db96b6227b5ba91ba4f9 100644
|
| --- a/pkg/analyzer/lib/src/generated/resolver.dart
|
| +++ b/pkg/analyzer/lib/src/generated/resolver.dart
|
| @@ -1162,7 +1162,8 @@ class ConstantVerifier extends RecursiveAstVisitor<Object> {
|
| identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL) ||
|
| identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_INT) ||
|
| identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM) ||
|
| - identical(dataErrorCode, CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT) ||
|
| + identical(dataErrorCode,
|
| + CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT) ||
|
| identical(dataErrorCode,
|
| CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH) ||
|
| identical(dataErrorCode,
|
| @@ -10916,6 +10917,22 @@ class ResolverVisitor extends ScopedVisitor {
|
| }
|
|
|
| @override
|
| + Object visitDefaultFormalParameter(DefaultFormalParameter node) {
|
| + super.visitDefaultFormalParameter(node);
|
| + FormalParameterList parent = node.parent;
|
| + AstNode grandparent = parent.parent;
|
| + if (grandparent is ConstructorDeclaration &&
|
| + grandparent.constKeyword != null) {
|
| + // For const constructors, we need to clone the ASTs for default formal
|
| + // parameters, so that we can use them during constant evaluation.
|
| + ParameterElement element = node.element;
|
| + (element as ConstVariableElement).constantInitializer =
|
| + new ConstantAstCloner().cloneNode(node.defaultValue);
|
| + }
|
| + return null;
|
| + }
|
| +
|
| + @override
|
| Object visitDoStatement(DoStatement node) {
|
| _overrideManager.enterScope();
|
| try {
|
|
|