[java] restores multifaceted switch labels support (parser/PSI + basic highlighting)

This commit is contained in:
Roman Shevchenko
2018-11-09 18:22:32 +01:00
parent 4e3fabc5db
commit 14bc258e3f
28 changed files with 278 additions and 121 deletions
@@ -59,6 +59,19 @@ class EnhancedSwitchStatements {
switch (E.valueOf("E1")) {
case <error descr="Constant expression required">null</error> -> noop();
case <error descr="An enum switch case label must be the unqualified name of an enumeration constant">E.E1</error> -> noop();
case E2 -> noop();
}
switch (new Random().nextInt()) {
case <error descr="Duplicate label '1'">1</error>, <error descr="Duplicate label '1'">1</error> -> noop();
}
switch (new Random().nextInt()) {
case 1, <error descr="Duplicate label '2'">2</error>:
noop(); break;
case 3, <error descr="Duplicate label '2'">2</error>:
noop(); break;
}
}