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

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

Issue 22279006: Fix for switch type inferrence (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add test Created 7 years, 4 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 | tests/compiler/dart2js_extra/12320_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart b/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
index 12389eef60e7aa2771c0cce057c8d51bd380bdad..747f072c758dc4b111d3fb68ac8f8195e2b3e6a0 100644
--- a/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
@@ -975,17 +975,9 @@ abstract class InferrerVisitor<T> extends ResolvedVisitor<T> {
List<LocalsHandler<T>> localsToMerge = <LocalsHandler<T>>[];
for (SwitchCase switchCase in node.cases) {
- if (switchCase.isDefaultCase) {
- // If there is a default case, the current values of the local
- // variable might be overwritten, so we don't need the current
- // [locals] for the join block.
- locals = saved;
- visit(switchCase);
- } else {
- locals = new LocalsHandler<T>.from(saved, switchCase);
- visit(switchCase);
- localsToMerge.add(locals);
- }
+ locals = new LocalsHandler<T>.from(saved, switchCase);
+ visit(switchCase);
+ localsToMerge.add(locals);
}
saved.mergeAll(localsToMerge);
locals = saved;
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/12320_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698