mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 10:48:09 +07:00
[java-highlighting] IDEA-324327 Constant associated with switch block must be used with primitives or String
GitOrigin-RevId: 864329b3d6cbefdf9c72358064b1e14f2fc4a1e3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
014b89199b
commit
0254c50753
@@ -0,0 +1,17 @@
|
||||
public class ConstantAssignment {
|
||||
void dd(Double i) {
|
||||
switch (i) {
|
||||
case <error descr="Unexpected type. Found: 'double', required: 'char, byte, short, int, Character, Byte, Short, Integer, String'">1.0</error> -> System.out.println(1);
|
||||
default -> throw new IllegalStateException("Unexpected value: " + i);
|
||||
}
|
||||
}
|
||||
|
||||
void dd2(Long i) {
|
||||
switch (i) {
|
||||
case <error descr="Unexpected type. Found: 'long', required: 'char, byte, short, int, Character, Byte, Short, Integer, String'">1L</error>:
|
||||
System.out.println(1);
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected value: " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user