mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-14 15:45:27 +07:00
(cherry picked from commit d6c0f396582c7a1c1f466887a0358793851d58bc) GitOrigin-RevId: 447bb655fd409d5838f96896a4dec3a5b0703d1f
29 lines
949 B
Java
29 lines
949 B
Java
package dfa;
|
|
|
|
public class MixFloatingPointWithIntegralLiterals {
|
|
private static float aaa = 2;
|
|
|
|
static void main(String[] args) {
|
|
switch (1.0) {
|
|
case <error descr="Incompatible types. Found: 'int', required: 'double'">1</error> -> System.out.println(1);
|
|
default -> System.out.println(2);
|
|
}
|
|
switch (1.0) {
|
|
case 1.0 -> System.out.println(1);
|
|
default -> System.out.println(2);
|
|
}
|
|
switch (1.0) {
|
|
case <error descr="Incompatible types. Found: 'char', required: 'double'">'c'</error> -> System.out.println(1);
|
|
default -> System.out.println(2);
|
|
}
|
|
switch (1.0f) {
|
|
case <error descr="Incompatible types. Found: 'int', required: 'float'">1</error> -> System.out.println(1);
|
|
default -> System.out.println(2);
|
|
}
|
|
switch (1.0f) {
|
|
case <error descr="Constant expression required">aaa</error> -> System.out.println(1);
|
|
default -> System.out.println(2);
|
|
}
|
|
}
|
|
}
|