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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart

Issue 182373002: Fix bad type-inferrence for logical expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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: sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart b/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
index 86662f7dcb798a5ba86b62cd839375bd13f04499..12cbf777e445c1e2e341e1b0e70fbe74d2cf1720 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
@@ -842,6 +842,7 @@ abstract class InferrerVisitor
} else if ("&&" == op.source) {
conditionIsSimple = false;
bool oldAccumulateIsChecks = accumulateIsChecks;
+ assert(accumulateIsChecks || isChecks == null);
accumulateIsChecks = true;
if (isChecks == null) isChecks = <Send>[];
visit(node.receiver);
@@ -863,6 +864,7 @@ abstract class InferrerVisitor
updateIsChecks(tests, usePositive: false);
bool oldAccumulateIsChecks = accumulateIsChecks;
accumulateIsChecks = false;
+ isChecks = null;
ngeoffray 2014/02/27 10:33:12 How about an abstraction: bool stopAccumulatingIs
floitsch 2014/02/27 16:07:08 Added helper. Changed the assert from the '&&' in
visit(node.arguments.head);
accumulateIsChecks = oldAccumulateIsChecks;
saved.mergeDiamondFlow(locals, null);
« no previous file with comments | « no previous file | tests/compiler/dart2js/simple_inferrer_and_or_test.dart » ('j') | tests/language/logical_expression2_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698