diff options
Diffstat (limited to 'mcs/errors/cs0163-2.cs')
-rw-r--r-- | mcs/errors/cs0163-2.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mcs/errors/cs0163-2.cs b/mcs/errors/cs0163-2.cs new file mode 100644 index 0000000000..dfdd9c1225 --- /dev/null +++ b/mcs/errors/cs0163-2.cs @@ -0,0 +1,20 @@ +// CS0163: Control cannot fall through from one case label `case 1:' to another +// Line: 14 + +using System; +using System.Collections.Generic; + +static class C +{ + public static IEnumerable<int> Test (int key) + { + switch (key) { + case 1: + yield return 0; + case 2: + yield return 2; + default: + throw new ArgumentOutOfRangeException ("symbol:" + key); + } + } +}
\ No newline at end of file |