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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Issue 2953503002: Only set types of conditional expressions in strong mode. (Closed)
Patch Set: Created 3 years, 6 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/front_end/lib/src/fasta/type_inference/type_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 5faf37545711d5ed2cb9da440701048008975739..1efc05f797d9bc72eb9666fa44ef0d924e07853e 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -664,7 +664,9 @@ abstract class TypeInferrerImpl extends TypeInferrer {
listener.methodInvocationEnter(expression, typeContext) || typeNeeded;
// First infer the receiver so we can look up the method that was invoked.
var receiverType = inferExpression(receiver, null, true);
- receiverVariable?.type = receiverType;
+ if (strongMode) {
+ receiverVariable?.type = receiverType;
+ }
bool isOverloadedArithmeticOperator = false;
Member interfaceMember =
findMethodInvocationMember(receiverType, desugaredInvocation);
@@ -719,7 +721,9 @@ abstract class TypeInferrerImpl extends TypeInferrer {
listener.propertyGetEnter(expression, typeContext) || typeNeeded;
// First infer the receiver so we can look up the getter that was invoked.
var receiverType = inferExpression(receiver, null, true);
- receiverVariable?.type = receiverType;
+ if (strongMode) {
+ receiverVariable?.type = receiverType;
+ }
Member interfaceMember =
findInterfaceMember(receiverType, desugaredGet.name, fileOffset);
if (isTopLevel &&
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart ('k') | pkg/front_end/testcases/escape.dart.direct.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698