hg: amber/amber: allow statements before this, super in a constructor

Brian Goetz brian.goetz at oracle.com
Sun Jan 7 16:11:09 UTC 2018


Yes, this is something people have wanted for a long time. There were a 
number of historical impediments to getting there, having to do with 
verification (verifying that the super <init> is called exactly once is 
one of the nastiest bits of the verifier.)  A number of verifier issues 
were addressed over the years, that enabled us to eventually get here.

And yes, this interacts nicely with records.  I'll write up the details 
soon.

On 1/7/2018 7:09 AM, Remi Forax wrote:
> Very cool,
> always wanted to do that in Java,
> i suppose it's a preparation for the 'default' call in constructor.
>
> Rémi
>
> ----- Mail original -----
>> De: "Vicente Romero" <vicente.romero at oracle.com>
>> À: "amber-dev" <amber-dev at openjdk.java.net>
>> Envoyé: Dimanche 7 Janvier 2018 03:48:25
>> Objet: hg: amber/amber: allow statements before this, super in a constructor
>> Changeset: 35b9d7ffcd88
>> Author:    vromero
>> Date:      2018-01-06 21:42 -0500
>> URL:       http://hg.openjdk.java.net/amber/amber/rev/35b9d7ffcd88
>>
>> allow statements before this, super in a constructor
>>
>> ! src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
>> !
>> src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
>> - test/langtools/tools/javac/diags/examples/CallMustBeFirst.java
>> + test/langtools/tools/javac/diags/examples/OnlyOneSuper.java



More information about the amber-dev mailing list