[records] Spec for next version of Record Classes JEP
gavin.bierman at oracle.com
Wed Oct 14 15:31:54 UTC 2020
> On 29 Sep 2020, at 16:50, Tagir Valeev <amaembo at gmail.com> wrote:
> The only nit-pick is that it says "if a canonical constructor
> is declared explicitly". However, from 8.10.4 one may derive that
> compact constructor is a canonical constructor, so if compact
> canonical constructor is explicitly declared then, per 8.10.5 it looks
> like annotation should be discarded but it's not. Probably it's better
> to write in 8.10.5 something like "if a non-compact canonical
> constructor is declared explicitly". Well, probably I'm seeing things.
No, you’re right. A compact constructor gets its formal parameter list from the record component list, and so you get any annotations that are applicable. I have clarified this in 8.10.4.
If we keep 8.10.5, then it needs wording much as you suggest; but I see that Brian is arguing that we shouldn’t treat non-propagating annotations as errors.
More information about the amber-spec-experts