[sealed-types] Draft Spec for JEP 360 Sealed Types (Preview)
Gavin Bierman
gavin.bierman at oracle.com
Fri Jun 5 10:01:46 UTC 2020
Hi Zheka,
Thanks for your email. We decided to remove this feature and leave it for the next release. I explained this at the bottom of the email that you quoted, i.e.:
* We have removed the changes to narrowing reference conversion which allowed
for stricter checking of cast conversions wrt sealed type hierarchies. We have
decided to defer this feature until a later release to allow us to develop a
broader treatment of "disjoint types" that can be used not just in cast
conversion, but in other places such as bounds checking and pattern matching.
The refined cast conversion was nice to have, but really only will make a
difference when we get to patterns in switches, so it makes sense to spend some
more time now considering our design rather than refining cast conversion in a
piecewise manner.
Thanks,
Gavin
> On 4 Jun 2020, at 18:57, Zheka Kozlov <orionllmain at gmail.com> wrote:
>
> Hi Gavin.
>
> In February you proposed an enhancement to the type system where sealed-ness would be taken into account: https://mail.openjdk.java.net/pipermail/amber-spec-experts/2020-February/002018.html <https://mail.openjdk.java.net/pipermail/amber-spec-experts/2020-February/002018.html>
>
> Was this proposal rejected? I don't see anything in the spec about it.
>
> вт, 21 апр. 2020 г. в 04:55, Gavin Bierman <gavin.bierman at oracle.com <mailto:gavin.bierman at oracle.com>>:
> The latest (and hopefully final) draft of JEP 360 (Sealed Types) is available at:
>
> http://cr.openjdk.java.net/~gbierman/jep360/latest <http://cr.openjdk.java.net/~gbierman/jep360/latest>
>
> The changes since the last draft was circulated in February [1]:
>
> * Some minor typos have been corrected, including changing the title of 8.1.6.
>
> * We have make corrections in a number of places to make it clear that the name
> in a `permits` clause is not a type (and can not be annotated, for example).
>
> * We now require a functional interface to not be `sealed`, rather than imposing
> checks on target types of lambda expressions.
>
> * We have removed the changes to narrowing reference conversion which allowed
> for stricter checking of cast conversions wrt sealed type hierarchies. We have
> decided to defer this feature until a later release to allow us to develop a
> broader treatment of "disjoint types" that can be used not just in cast
> conversion, but in other places such as bounds checking and pattern matching.
>
> The refined cast conversion was nice to have, but really only will make a
> difference when we get to patterns in switches, so it makes sense to spend some
> more time now considering our design rather than refining cast conversion in a
> piecewise manner.
>
> Thanks,
> Gavin
>
> [1] https://mail.openjdk.java.net/pipermail/amber-spec-experts/2020-February/002031.html <https://mail.openjdk.java.net/pipermail/amber-spec-experts/2020-February/002031.html>
>
More information about the amber-spec-observers
mailing list