mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8023545: Misleading error message when using diamond operator with private constructor
Reviewed-by: jjg
This commit is contained in:
parent
06caeea3d6
commit
cab6b226ff
3 changed files with 38 additions and 16 deletions
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* @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() {}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue