RFR: JEP 360: Sealed Types (Preview)

Paul Sandoz paul.sandoz at oracle.com
Tue Apr 14 19:51:08 UTC 2020

Very nice, another block in the pattern matching tower readies itself for placement :-)

Some minor comments on the latest here as of writing:

https://openjdk.java.net/jeps/360 <https://openjdk.java.net/jeps/360>

- "Do not change final in any way.”
“It is not a goal to change final in any way."

- You still mention Node instead of Shape in some places.

- On the set of restrictions you mention 

It is an error if a class has a sealed direct superclass or superinterface and the class is not an enum type or the class is not explicitly declared sealed, final or non-sealed.

To be complete I presume you can add records to that restriction.


> On Apr 13, 2020, at 9:03 AM, Vicente Romero <vicente.romero at oracle.com> wrote:
> Hi all,
> The sealed types JEP was already reviewed a while back when we were planning to include it in JDK14. It finally fell off that boat but it is being considered now for JDK15. There have been some changes since then mostly related to subtypes of a sealed type. Before we were planning to infer finality, sealness or non-sealness in the subtypes. We steered away from that direction in favor of explicit declaration at the subtype. I would like to ask for another review of the current version of the JEP that reflects these changes. The JEP is at [1] and the last version of the spec is at [2],
> Thanks,
> Vicente
> [1] https://bugs.openjdk.java.net/browse/JDK-8227043
> [2] http://cr.openjdk.java.net/~gbierman/jep360/jep360-20200228/specs/sealed-types-jls.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20200414/300f87ee/attachment.htm>

More information about the compiler-dev mailing list