[sealed-types] Draft Spec for JEP 360 Sealed Types (Preview)

Fred Toussi fredt at users.sourceforge.net
Wed Jun 3 13:56:20 UTC 2020


Why not use "non sealed" instead and define "non" as a "contextual keyword"? It is simpler, reusable and looks better.

Fred

On Wed, Jun 3, 2020, at 14:16, Gavin Bierman wrote:
> 
> 
> > On 26 May 2020, at 21:54, Gavin Bierman <gavin.bierman at oracle.com> wrote:
> > 
> > I fixed a number of small bugs in the spec. The latest draft is available at:
> > 
> > 	 <http://cr.openjdk.java.net/~gbierman/jep360/latest/>http://cr.openjdk.java.net/~gbierman/jep360/latest/ <http://cr.openjdk.java.net/~gbierman/jep360/latest/>
> > 
> > Thanks,
> > Gavin
> 
> 
> PS: I should like to mention one aspect of this spec that we intend to 
> change in JDK 16 (it was too late in the day for JDK 15). We currently 
> specify in 3.9 that `non-sealed` is a keyword. We couldn’t simply play 
> the trick that it was a restricted identifier, as identifiers cannot 
> contain the `-` character. However, this is not where we intend to 
> land. We would prefer to introduce a notion of “contextual keyword” and 
> use this to properly deal with not just ‘non-sealed`, but also `var`, 
> `yield`, and `sealed` (the restricted identifiers), as well as the ten 
> restricted keywords (`open`, `module`, `requires`, `transitive`, 
> `exports`, `opens`, `to`, `uses`, `provides`, and `with`).
> 
> We will share details of this once they are ready, but I wanted to 
> share our intent here now.
> 
> Gavin 
> 
> 
>


More information about the amber-spec-observers mailing list