1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
/*
* @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");
}
}
}
|