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

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

Issue 1597893003: Don't include implicit initializing formal types in summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
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 fc78cbc2310959008a3c8e2a493684266ebb10d7..13d568870817c9f97de5ac933963014ac6dd8554 100644
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
@@ -608,17 +608,23 @@ class _LibrarySerializer {
}
b.isInitializingFormal = parameter.isInitializingFormal;
DartType type = parameter.type;
- if (type is FunctionType) {
- b.isFunctionTyped = true;
- if (!type.returnType.isVoid) {
- b.type = serializeTypeRef(type.returnType, parameter);
- }
- b.parameters = type.parameters
- .map((parameter) => serializeParam(parameter, context))
- .toList();
+ if (parameter.isInitializingFormal && parameter.hasImplicitType) {
+ b.hasImplicitType = true;
+ // We don't store the type of initializing formals that have an implicit
+ // type, because the type is inherited from the field.
} else {
- b.type = serializeTypeRef(type, context);
- b.hasImplicitType = parameter.hasImplicitType;
+ if (type is FunctionType) {
+ b.isFunctionTyped = true;
+ if (!type.returnType.isVoid) {
+ b.type = serializeTypeRef(type.returnType, parameter);
+ }
+ b.parameters = type.parameters
+ .map((parameter) => serializeParam(parameter, context))
+ .toList();
+ } else {
+ b.type = serializeTypeRef(type, context);
+ b.hasImplicitType = parameter.hasImplicitType;
+ }
}
return b;
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698