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

Unified Diff: pkg/analyzer/lib/src/generated/element_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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/element_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index b61eb2bdbf2efeb36a9fdbbffc882c05e6bc48c1..d3fdd99d07a9d983d8c66d7b174d6216dc5c9f12 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -1847,12 +1847,13 @@ class ElementResolver extends SimpleAstVisitor<Object> {
// for `staticType` and `propagatedType` on Expression.
DartType _propagatedInvokeTypeIfBetter(
DartType propagatedType, DartType staticType) {
- if (propagatedType != null &&
- (staticType == null || propagatedType.isMoreSpecificThan(staticType))) {
- return propagatedType;
- } else {
+ if (_resolver.strongMode || propagatedType == null) {
return null;
}
+ if (staticType == null || propagatedType.isMoreSpecificThan(staticType)) {
+ return propagatedType;
+ }
+ return null;
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698