Refinements for sealed types

forax at forax at
Mon Aug 19 22:40:40 UTC 2019

> De: "Brian Goetz" <brian.goetz at>
> À: "Remi Forax" <forax at>
> Cc: "amber-spec-experts" <amber-spec-experts at>
> 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). 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the amber-spec-experts mailing list