Version Used:
master branch 11.11.2020
Steps to Reproduce:
Compile and run the following code:
using static System.Console;
void M(object o) {
switch (o) {
case (int) or string:
WriteLine("OK");
break;
}
}
M(1);
Expected Behavior:
"OK" is printed.
Actual Behavior:
Compiler produces following errors:
error CS1001: Identifier expected
error CS1002: ; expected
error CS1513: } expected
error CS1513: } expected
error CS1022: Type or namespace definition, or end-of-file expected
error CS1022: Type or namespace definition, or end-of-file expected
error CS1022: Type or namespace definition, or end-of-file expected
error CS0103: The name 'or' does not exist in the current context
error CS0139: No enclosing loop out of which to break or continue
error CS8070: Control cannot fall out of switch from final case label ('case (int) or ')
Version Used:
master branch 11.11.2020
Steps to Reproduce:
Compile and run the following code:
Expected Behavior:
"OK" is printed.
Actual Behavior:
Compiler produces following errors: