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

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

Issue 2348583005: fix #27382, tweak inference heuristic when we have no upper bound info (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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/type_system.dart
diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart
index 7582312dba9547e8405154934de6a438f6701e2c..0488553c43014ca14e9210c463bb5279263b57a8 100644
--- a/pkg/analyzer/lib/src/generated/type_system.dart
+++ b/pkg/analyzer/lib/src/generated/type_system.dart
@@ -1604,7 +1604,9 @@ class _StrongInferenceTypeSystem extends StrongTypeSystemImpl {
}
inferredTypes[i] =
- variance.passedIn || lowerBound.isBottom ? upperBound : lowerBound;
+ variance.passedIn && !upperBound.isDynamic || lowerBound.isBottom
+ ? upperBound
+ : lowerBound;
}
// Return the instantiated type.
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698