| Index: pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| index c2a625bf29f69a2ab264da555505f6866af128cf..cb799b93f1a36a4d4e23ed2b08b9605c5406287d 100644
|
| --- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| +++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| @@ -643,11 +643,17 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
|
| b.parameters = formalParameters.parameters
|
| .map((FormalParameter p) => p.accept(this))
|
| .toList();
|
| - if (!isSemanticallyStatic) {
|
| - for (int i = 0; i < formalParameters.parameters.length; i++) {
|
| - if (!b.parameters[i].isFunctionTyped &&
|
| - b.parameters[i].type == null) {
|
| - b.parameters[i].inferredTypeSlot = assignSlot();
|
| +
|
| + for (int i = 0; i < formalParameters.parameters.length; i++) {
|
| + UnlinkedParamBuilder p = b.parameters[i];
|
| + if (!p.isFunctionTyped && p.type == null) {
|
| + // Strong mode infers parameters in two cases:
|
| + // - instance members (i.e. not semantically static),
|
| + // - parameters with default values, except initializing formals
|
| + // (the type comes from the field).
|
| + if (!isSemanticallyStatic ||
|
| + p.initializer != null && !p.isInitializingFormal) {
|
| + p.inferredTypeSlot = assignSlot();
|
| }
|
| }
|
| }
|
|
|