Index: pkg/analyzer/lib/src/generated/resolver.dart |
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart |
index f286a87e59a93eec254f02988dc21557154a9cd5..15c41d6218239ff744561fdab9bb3775ba2e2c5d 100644 |
--- a/pkg/analyzer/lib/src/generated/resolver.dart |
+++ b/pkg/analyzer/lib/src/generated/resolver.dart |
@@ -4857,7 +4857,7 @@ class InferenceContext { |
* Place an info node into the error stream indicating that a |
* [type] has been inferred as the type of [node]. |
*/ |
- void recordInference(AstNode node, DartType type) { |
+ void recordInference(Expression node, DartType type) { |
if (!_inferenceHints) { |
return; |
} |
@@ -5653,11 +5653,6 @@ class ResolverVisitor extends ScopedVisitor { |
bool resolveOnlyCommentInFunctionBody = false; |
/** |
- * True if we're analyzing in strong mode. |
- */ |
- bool _strongMode; |
- |
- /** |
* Body of the function currently being analyzed, if any. |
*/ |
FunctionBody _currentFunctionBody; |
@@ -5688,7 +5683,6 @@ class ResolverVisitor extends ScopedVisitor { |
this.typeSystem = definingLibrary.context.typeSystem; |
bool strongModeHints = false; |
AnalysisOptions options = definingLibrary.context.analysisOptions; |
- _strongMode = options.strongMode; |
if (options is AnalysisOptionsImpl) { |
strongModeHints = options.strongModeHints; |
} |
@@ -6379,24 +6373,13 @@ class ResolverVisitor extends ScopedVisitor { |
@override |
Object visitDefaultFormalParameter(DefaultFormalParameter node) { |
- ParameterElement element = node.element; |
- InferenceContext.setType(node.defaultValue, element.type); |
+ InferenceContext.setType(node.defaultValue, node.parameter.element?.type); |
super.visitDefaultFormalParameter(node); |
+ ParameterElement element = node.element; |
if (element.initializer != null && node.defaultValue != null) { |
(element.initializer as FunctionElementImpl).returnType = |
node.defaultValue.staticType; |
} |
- if (_strongMode && |
- node.defaultValue != null && |
- element.hasImplicitType && |
- element is! FieldFormalParameterElement) { |
- |
- DartType type = node.defaultValue.staticType; |
- if (!type.isBottom && !type.isDynamic) { |
- (element as ParameterElementImpl).type = type; |
- inferenceContext.recordInference(node, type); |
- } |
- } |
// Clone the ASTs for default formal parameters, so that we can use them |
// during constant evaluation. |
if (!LibraryElementImpl.hasResolutionCapability( |