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

Unified Diff: test/kernel/regression/switch_execution_case_t02.dart.txt

Issue 2205263002: Implement fall-through errors. (Closed) Base URL: git@github.com:dart-lang/rasta.git@errors
Patch Set: Created 4 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
Index: test/kernel/regression/switch_execution_case_t02.dart.txt
diff --git a/test/kernel/regression/switch_execution_case_t02.dart.txt b/test/kernel/regression/switch_execution_case_t02.dart.txt
new file mode 100644
index 0000000000000000000000000000000000000000..216e6f4cce76ac820bbcf0c901eda8de512a7eb7
--- /dev/null
+++ b/test/kernel/regression/switch_execution_case_t02.dart.txt
@@ -0,0 +1,62 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method test(dynamic value) → dynamic {
+ dynamic result;
+ #L1:
+ switch(value) {
+ #L2:
+ case 1:
+ {
+ result = 1;
+ break #L1;
+ }
+ #L3:
+ case 2:
+ {
+ result = 2;
+ throw core::_fallThroughError();
+ }
+ #L4:
+ case 3:
+ {
+ result = 3;
+ throw core::_fallThroughError();
+ }
+ #L5:
+ default:
+ {
+ result = 4;
+ throw core::_fallThroughError();
+ }
+ }
+ return result;
+}
+static method testEmptyCases(dynamic value) → dynamic {
+ dynamic result;
+ #L6:
+ switch(value) {
+ #L7:
+ case 1:
+ case 2:
+ {
+ result = 1;
+ throw core::_fallThroughError();
+ }
+ #L8:
+ case 3:
+ case 4:
+ {
+ result = 2;
+ break #L6;
+ }
+ #L9:
+ case 5:
+ case 6:
+ default:
+ throw core::_fallThroughError();
+ }
+ return result;
+}
+static method main() → dynamic {}
« lib/kernel/fall_through_visitor.dart ('K') | « test/kernel/regression/switch_execution_case_t02.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698