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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 2380863003: fix #27135 and fix #27449 strong mode does not use propagated types (Closed)
Patch Set: Created 4 years, 3 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/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;
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/lib/src/generated/static_type_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698