Re: [sealed] Sealed local classes?

2019-10-09 Thread Brian Goetz
In your other email I guess you are referring to anonymous classes implementing a sealed interface, right? E.g. sealed interface Foo {     void m();     /* static final */ Foo f1 = new Foo() { ... }     /* static final */ Foo f2 = () -> {}; } Right.  We already restrict anon and lambda in

Re: [sealed] Sealed local classes?

2019-10-09 Thread Maurizio Cimadamore
Good catch! I fully support the restriction. In your other email I guess you are referring to anonymous classes implementing a sealed interface, right? E.g. sealed interface Foo {     void m();     /* static final */ Foo f1 = new Foo() { ... }     /* static final */ Foo f2 = () -> {}; } Tha

Re: [sealed] Sealed local classes?

2019-10-09 Thread Remi Forax
I agree, PermittedSubtypes should only contain stable names :) Rémi - Mail original - > De: "Brian Goetz" > À: "amber-spec-experts" > Envoyé: Mercredi 9 Octobre 2019 23:35:48 > Objet: Re: [sealed] Sealed local classes? >> Proposal: ban `sealed` and `non-sealed` modifiers on _local_ cla

Re: [sealed] Sealed local classes?

2019-10-09 Thread Remi Forax
I agree, PermittedSubtypes should only contains stable names. Rémi - Mail original - > De: "Brian Goetz" > À: "amber-spec-experts" > Envoyé: Mercredi 9 Octobre 2019 23:26:26 > Objet: [sealed] Sealed local classes? > It is allowable, though somewhat silly, to put the `final` modifier on

Re: [records] Native members

2019-10-09 Thread Remi Forax
- Mail original - > De: "Brian Goetz" > À: "amber-spec-experts" > Envoyé: Mercredi 9 Octobre 2019 23:10:40 > Objet: [records] Native members > Jon has pointed out that it is possible to declare a record with native > methods and/or constructor. > > Let's just add `native` to the set of

Re: [sealed] Sealed local classes?

2019-10-09 Thread Brian Goetz
Proposal: ban `sealed` and `non-sealed` modifiers on _local_ classes and interfaces. And we would want to extend the ban we have for the other two forms of "subclasses inside implementations", lambdas and inner classes, to local classes.

[sealed] Sealed local classes?

2019-10-09 Thread Brian Goetz
It is allowable, though somewhat silly, to put the `final` modifier on local classes. From a hierarchy-protection point of view, allowing local classes to be `sealed` is also silly, as it cannot be extended from outside the method anyway, and even if it could, such types can't show up in APIs

[records] Native members

2019-10-09 Thread Brian Goetz
Jon has pointed out that it is possible to declare a record with native methods and/or constructor. Let's just add `native` to the set of modifiers that are not allowed on members of records

Re: Draft Object Serialization Specification for records - construction/destruction

2019-10-09 Thread Brian Goetz
You are not wrong. In fact, I had the very same thought ( and the implementation does similar ), but we want to leave room here for deconstructors/extractors. With the wording in the current draft, it will be possible to switch the implementation without the need to update the specification

Re: Record Component attributes

2019-10-09 Thread Remi Forax
- Mail original - > De: "Remi Forax" > À: "Brian Goetz" > Cc: "amber-spec-experts" > Envoyé: Mercredi 9 Octobre 2019 18:44:23 > Objet: Re: Record Component attributes > - Mail original - >> De: "Brian Goetz" >> À: "Remi Forax" , "amber-spec-experts" >> >> Envoyé: Mercredi 9

Re: Record Component attributes

2019-10-09 Thread forax
- Mail original - > De: "Brian Goetz" > À: "Remi Forax" , "amber-spec-experts" > > Envoyé: Mercredi 9 Octobre 2019 17:59:56 > Objet: Re: Record Component attributes >> just to be sure, do we agree that a record component can be deprecated, >> synthetic, have a generic signature, have un

Re: Record Component attributes

2019-10-09 Thread Brian Goetz
just to be sure, do we agree that a record component can be deprecated, synthetic, have a generic signature, have unknown attributes, have annotation and type annotations ? Deprecated: not clear what this would mean, since removing a component is not a BC or SC change, and therefore remova

Record Component attributes

2019-10-09 Thread Remi Forax
Hi all, just to be sure, do we agree that a record component can be deprecated, synthetic, have a generic signature, have unknown attributes, have annotation and type annotations ? so the attributes with a special meaning are SIGNATURE, DEPRECATED, SYNTHETIC, RUNTIME_VISIBLE_ANNOTATIONS, RUNT