mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
[java-highlighting] IDEA-324327 IJ-CR-110223 Constant associated with switch block must be used with primitives or String
GitOrigin-RevId: fab5d57dc37c1694607686e268072473ec60a4de
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fef71943cd
commit
21d97bbbb0
@@ -1,14 +1,14 @@
|
||||
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);
|
||||
case <error descr="Incompatible types. Type of constant label: 'double', switch selector type: 'java.lang.Double'">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>:
|
||||
case <error descr="Incompatible types. Type of constant label: 'long', switch selector type: 'java.lang.Long'">1L</error>:
|
||||
System.out.println(1);
|
||||
default:
|
||||
throw new IllegalStateException("Unexpected value: " + i);
|
||||
|
||||
Reference in New Issue
Block a user