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 26b997d18b16bb2a6668549fbb376a9973130704..3e1dc6bfb3ff04166ad35619c0e6ca7e38eda4ec 100644 |
--- a/pkg/analyzer/lib/src/generated/resolver.dart |
+++ b/pkg/analyzer/lib/src/generated/resolver.dart |
@@ -6020,7 +6020,7 @@ class ResolverVisitor extends ScopedVisitor { |
void recordPropagatedTypeIfBetter(Expression expression, DartType type, |
[bool hasOldPropagatedType = false]) { |
// Ensure that propagated type invalid. |
- if (type == null || type.isDynamic || type.isBottom) { |
+ if (strongMode || type == null || type.isDynamic || type.isBottom) { |
if (!hasOldPropagatedType) { |
expression.propagatedType = null; |
} |
@@ -7422,7 +7422,9 @@ class ResolverVisitor extends ScopedVisitor { |
return; |
} |
// set propagated type for the closure |
- closure.propagatedType = expectedClosureType; |
+ if (!strongMode) { |
+ closure.propagatedType = expectedClosureType; |
+ } |
// set inferred types for parameters |
NodeList<FormalParameter> parameters = closure.parameters.parameters; |
List<ParameterElement> expectedParameters = expectedClosureType.parameters; |