[sealed-types] Draft Spec for JEP 360 Sealed Types (Preview)
gavin.bierman at oracle.com
Wed Jun 3 13:16:11 UTC 2020
> 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/>
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the amber-spec-experts