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

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

Issue 2940703002: Fix top level type inference for binary operators. (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 344851102078e9336c4436672b256e80337c4714..f51ba659ba6d2a52f6cb2b01ac588e897e9452d4 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
@@ -549,7 +549,7 @@ abstract class TypeInferrerImpl extends TypeInferrer {
}
// TODO(paulberry): if we are doing top level inference and type arguments
// were omitted, report an error.
- if (!isTopLevel) {
+ if (!isTopLevel || isOverloadedArithmeticOperator) {
int i = 0;
_forEachArgument(arguments, (name, expression) {
DartType formalType = name != null

Powered by Google App Engine
This is Rietveld 408576698