> De: "Brian Goetz" <brian.go...@oracle.com>
> À: "Remi Forax" <fo...@univ-mlv.fr>
> Cc: "amber-spec-experts" <amber-spec-experts@openjdk.java.net>
> Envoyé: Lundi 19 Août 2019 15:07:35
> Objet: Re: Refinements for sealed types

>>> There are several ways to reduce the ceremony
>>> - implicit declaration of sealed subtypes if the super type is sealed
>>> - implicit declaration of permit clauses
>>> and we may want to choose one, the other or both.
> For the record, there is also a third possible way: inferring `extends X`. I
> don’t particularly love it, especially as it is mutually exclusive with
> inferring the permits clause. But I include it for completeness.

We tried that by saying if you are inside the declaration of a sealed type, the 
extends can be inferred but it doesn't play well with inner classes that are 
already using the fact that there are enclosed to have another semantics. 
Basically going in that direction means separating the sum type use case (which 
in that case will have its own syntax) and the closed hierarchy use case (which 
can use the keyword sealed). 

Rémi 

Reply via email to