Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: pkg/analyzer/lib/src/summary/summarize_elements.dart

Issue 2010993002: Migrate UnlinkedParam.defaultValue to UnlinkedExecutable.bodyExpr. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_ast.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_ast.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698