jdk-24/test/langtools/tools/javac/patterns/UncheckedWarningOnMatchesTest.java
2023-01-17 04:43:40 +00:00

19 lines
551 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8187429 8231827
* @summary Missing unchecked conversion warning
* @compile/fail/ref=UncheckedWarningOnMatchesTest.out -Xlint:unchecked -Werror -XDrawDiagnostics UncheckedWarningOnMatchesTest.java
*/
import java.util.ArrayList;
public class UncheckedWarningOnMatchesTest {
public static void meth() {
Object o = new ArrayList<UncheckedWarningOnMatchesTest>();
if (o instanceof ArrayList<Integer> ai) { // unchecked conversion
System.out.println("Blah");
}
}
}