| 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 98e3de4960e5cefb996aafa6b7c50804d3aaabce..50e1bb6611b47be703cebb842e28d256f514c0ec 100644
|
| --- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| +++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| @@ -902,10 +902,14 @@ 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) {
|
| + (!contextParent.isStatic && contextParent is! ConstructorElement ||
|
| + parameter.parameterKind != ParameterKind.REQUIRED)) {
|
| b.inferredTypeSlot = storeInferredType(type, context);
|
| }
|
| } else {
|
|
|