equal
deleted
inserted
replaced
|
1 /* |
|
2 * @test /nodynamicopyright/ |
|
3 * @bug 8231827 |
|
4 * @summary Match which involves a cast conversion |
|
5 * @compile/fail/ref=CastConversionMatch.out -XDrawDiagnostics --enable-preview -source ${jdk.version} CastConversionMatch.java |
|
6 */ |
|
7 |
|
8 public class CastConversionMatch { |
|
9 public static void main(String [] args) { |
|
10 Object o = 42; |
|
11 if (o instanceof int s) { |
|
12 System.out.println("Okay"); |
|
13 } else { |
|
14 throw new AssertionError("broken"); |
|
15 } |
|
16 System.out.println(">Test complete"); |
|
17 } |
|
18 } |