Type annotation on record component doesn't seem to be supported by javac ?

Vicente Romero vicente.romero at oracle.com
Thu Oct 10 13:36:42 UTC 2019



On 10/9/19 2:12 PM, Alex Buckley wrote:
> On 10/9/2019 8:30 AM, Vicente Romero wrote:
>> Of course the user of the record you wrote would be bugged as he 
>> wrote the type of the record component was: `String` not 
>> `java.lang.String`. The record constructor is automatically generated 
>> by the compiler, and for the generation of its arguments the full 
>> qualified type was being used. I have fixed this in order to use the 
>> same type as written by the user. If you update your repo your test 
>> case should compile,
>
> By carrying over the terms written in the original source code, you 
> have smartly and speedily paid off the fee charged by type 
> annotations, where the (in)ability to annotate terms which 
> syntactically look like type _uses_ but are actually mere "scoping 
> constructs" (package _names_, type _names_) was a deliberate JSR 308 
> policy.

yep luckily :)

>
> Alex
Vicente


More information about the amber-dev mailing list