test/tools/javac/T8023545/MisleadingErrorMsgDiamondPlusPrivateCtorTest.java

Wed, 23 Oct 2013 07:50:04 +0200

author
jlahoda
date
Wed, 23 Oct 2013 07:50:04 +0200
changeset 2165
864dafc5ab7a
parent 0
959103a6100f
permissions
-rw-r--r--

8026861: Wrong LineNumberTable for variable declarations in lambdas
Summary: Setting or correcting positions for many trees produced by LambdaToMethod.
Reviewed-by: vromero, rfield

     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 }

mercurial