Index: pkg/analyzer/lib/src/summary/summarize_elements.dart |
diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart |
index 432d414429e37d6438a6d5b4c028092784acfbeb..7c924741bc925ce56a26143e73cd88bde007659a 100644 |
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart |
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart |
@@ -919,21 +919,21 @@ class _CompilationUnitSerializer { |
b.type = serializeTypeRef(type, context); |
} |
} |
+ // TODO(scheglov) VariableMember.initializer is not implemented |
+ if (parameter is! VariableMember && parameter.initializer != null) { |
+ b.initializer = serializeExecutable(parameter.initializer); |
+ } |
if (parameter is ConstVariableElement) { |
ConstVariableElement constParameter = parameter as ConstVariableElement; |
Expression initializer = constParameter.constantInitializer; |
if (initializer != null) { |
- b.defaultValue = serializeConstExpr( |
+ b.initializer?.bodyExpr = serializeConstExpr( |
parameter, |
parameter.getAncestor((Element e) => e is ExecutableElement), |
initializer); |
b.defaultValueCode = parameter.defaultValueCode; |
} |
} |
- // TODO(scheglov) VariableMember.initializer is not implemented |
- if (parameter is! VariableMember && parameter.initializer != null) { |
- b.initializer = serializeExecutable(parameter.initializer); |
- } |
{ |
SourceRange visibleRange = parameter.visibleRange; |
if (visibleRange != null) { |