The Deprecated attribute is, effectively, Deprecated.  So I'm not interested in giving it any life support.

However, it is reasonable to allow the @Deprecated annotation on record components.  And, you can apply it there now!  And if you do, it will get propagated to fields, accessors, and constructor parameters, and reflection will reflect the right thing -- because its an annotation.

It is reasonable to add RECORD_COMPONENT to the target type, though not necessary.  This would cause it to be propagated through to the Record attribute, where reflection would report it.  I'm pretty not-interested in spending any spec or compiler effort on this, though.  Its an annotation; we support annotations.

On 1/9/2020 12:51 PM, fo...@univ-mlv.fr wrote:


------------------------------------------------------------------------

    *De: *"Brian Goetz" <brian.go...@oracle.com>
    *À: *"Remi Forax" <fo...@univ-mlv.fr>
    *Cc: *"amber-spec-experts" <amber-spec-experts@openjdk.java.net>
    *Envoyé: *Jeudi 9 Janvier 2020 16:07:50
    *Objet: *Re: [records] Record updates for Preview/2


        - @Deprecated on record components


    Please outline what you think we want on a separate thread?


Currently you can not deprecate a record component unlike in Scala or in Kotlin. We can either allow @Deprecated or pretend that people will never make mistake, change their mind, specification will never change, etc

How to fix the issue,
- as Dmitry Bessonov said on the amber mailing list, the Deprecated annotation should list ElementType.RECORD_COMPONENT as possible target. - the JVMS should be changed to allow the attribute Deprecated on record_component.

Rémi


Reply via email to