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 c9f655192cf5d1a6d0436c34c500eb4184278dfa..7a297fa62e0b2c21df522b29cad31358052e3b3f 100644 |
--- a/pkg/analyzer/lib/src/generated/resolver.dart |
+++ b/pkg/analyzer/lib/src/generated/resolver.dart |
@@ -239,12 +239,6 @@ class ElementBuilder extends RecursiveASTVisitor<Object> { |
Object visitDefaultFormalParameter(DefaultFormalParameter node) { |
ElementHolder holder = new ElementHolder(); |
- visit(holder, node.defaultValue); |
- FunctionElementImpl initializer = new FunctionElementImpl(); |
- initializer.functions = holder.functions; |
- initializer.labels = holder.labels; |
- initializer.localVariables = holder.localVariables; |
- initializer.parameters = holder.parameters; |
SimpleIdentifier parameterName = node.parameter.identifier; |
ParameterElementImpl parameter; |
if (node.parameter is FieldFormalParameter) { |
@@ -254,10 +248,17 @@ class ElementBuilder extends RecursiveASTVisitor<Object> { |
} |
parameter.const3 = node.isConst; |
parameter.final2 = node.isFinal; |
- parameter.initializer = initializer; |
parameter.parameterKind = node.kind; |
Expression defaultValue = node.defaultValue; |
if (defaultValue != null) { |
+ visit(holder, defaultValue); |
+ FunctionElementImpl initializer = new FunctionElementImpl.con2(defaultValue.beginToken.offset); |
+ initializer.functions = holder.functions; |
+ initializer.labels = holder.labels; |
+ initializer.localVariables = holder.localVariables; |
+ initializer.parameters = holder.parameters; |
+ initializer.synthetic = true; |
+ parameter.initializer = initializer; |
parameter.setDefaultValueRange(defaultValue.offset, defaultValue.length); |
} |
setParameterVisibleRange(node, parameter); |
@@ -623,7 +624,7 @@ class ElementBuilder extends RecursiveASTVisitor<Object> { |
} finally { |
_inFieldContext = wasInFieldContext; |
} |
- FunctionElementImpl initializer = new FunctionElementImpl(); |
+ FunctionElementImpl initializer = new FunctionElementImpl.con2(node.initializer.beginToken.offset); |
initializer.functions = holder.functions; |
initializer.labels = holder.labels; |
initializer.localVariables = holder.localVariables; |