jdk-24/test/langtools/tools/javac/T8023545/MisleadingErrorMsgDiamondPlusPrivateCtorTest.java
2017-09-12 19:03:39 +02:00

17 lines
469 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8023545
* @summary Misleading error message when using diamond operator with private constructor
* @compile/fail/ref=MisleadingErrorMsgDiamondPlusPrivateCtorTest.out -XDrawDiagnostics MisleadingErrorMsgDiamondPlusPrivateCtorTest.java
*/
public class MisleadingErrorMsgDiamondPlusPrivateCtorTest {
public void foo() {
MyClass<Object> foo = new MyClass<>();
}
}
class MyClass<E> {
private MyClass() {}
}