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

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

Issue 2109353004: Revert "fix #25794, infer parameter type from default value" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 50e1bb6611b47be703cebb842e28d256f514c0ec..98e3de4960e5cefb996aafa6b7c50804d3aaabce 100644
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
@@ -902,14 +902,10 @@ class _CompilationUnitSerializer {
DartType type = parameter.type;
if (parameter.hasImplicitType) {
Element contextParent = context.enclosingElement;
- // Strong mode infers parameters in two cases:
- // - instance members (i.e. not constructors or static members),
- // - parameters with default values, except initializing formals
- // (the type comes from the field).
if (!parameter.isInitializingFormal &&
contextParent is ExecutableElement &&
- (!contextParent.isStatic && contextParent is! ConstructorElement ||
- parameter.parameterKind != ParameterKind.REQUIRED)) {
+ !contextParent.isStatic &&
+ contextParent is! ConstructorElement) {
b.inferredTypeSlot = storeInferredType(type, context);
}
} else {
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698