Sealed types -- updated proposal

forax at univ-mlv.fr forax at univ-mlv.fr
Thu Jan 17 18:14:28 UTC 2019


> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Envoyé: Jeudi 17 Janvier 2019 19:03:21
> Objet: Re: Sealed types -- updated proposal

>>> Contextual keywords are usually OK as modifiers (as long as they don’t want to
>>> show up somewhere else), so `sealed` is not terrible.

>> ???, i'm confused,
>> a contextual keyword means it's only a keyword in some context, so if it shows
>> up somewhere else, it's not a keyword.

> Consider “extends”. Yes, it shows up in the class declaration grammar, but it
> also wants to show up in type bounds: <T extends Bar>. We have to think very
> carefully whether a contextual keyword we introduce today, when we might only
> be thinking of the declaration, will come back later in less constrained
> syntactic contexts.

Ok, "extends" is not a good example here ! (i force my student as read it as 'subtypes' if encosed in <>) 

What you are saying is that what if we introduce a contextual keyword and after think that the same construct should also be allowed in the middle of the code where the context keyword is ambiguous, we are in trouble. 
Yes, that's an issue. Thanks ! 

Rémi 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20190117/8fecf6ff/attachment.html>


More information about the amber-spec-experts mailing list