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

Unified Diff: pkg/analyzer/lib/src/generated/static_type_analyzer.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 | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/generated/strong_mode_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/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index 4ebd9b377a48a1fb58c0eb8d9fbc363f33f7cc6a..47e5599b9d5bee04b68a4c147da5c8e16745ffd6 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -2283,7 +2283,7 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
* @param type the propagated type of the node
*/
void _recordPropagatedType(Expression expression, DartType type) {
- if (type != null && !type.isDynamic && !type.isBottom) {
+ if (!_strongMode && type != null && !type.isDynamic && !type.isBottom) {
expression.propagatedType = type;
}
}
@@ -2299,6 +2299,9 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
*/
void _recordPropagatedTypeOfFunction(
ExecutableElement functionElement, FunctionBody body) {
+ if (_strongMode) {
+ return;
+ }
DartType propagatedReturnType =
_computePropagatedReturnTypeOfFunction(body);
if (propagatedReturnType == null) {
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/generated/strong_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698