Fri, 24 Apr 2020 03:58:51 +0100
Merge
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8023545
4 * @summary Misleading error message when using diamond operator with private constructor
5 * @compile/fail/ref=MisleadingErrorMsgDiamondPlusPrivateCtorTest.out -XDrawDiagnostics MisleadingErrorMsgDiamondPlusPrivateCtorTest.java
6 */
8 public class MisleadingErrorMsgDiamondPlusPrivateCtorTest {
9 public void foo() {
10 MyClass<Object> foo = new MyClass<>();
11 }
12 }
14 class MyClass<E> {
15 private MyClass() {}
16 }