RFR: JDK-8227046: compiler implementation for sealed classes, JDK-8227047: Javadoc for sealed types and JDK-8227044: javax.lang.model for sealed classes
Joe Darcy
joe.darcy at oracle.com
Fri May 22 17:44:39 UTC 2020
Hi Jan,
On 5/21/2020 5:55 AM, Jan Lahoda wrote:
> On 21. 05. 20 7:31, Joe Darcy wrote:
>> Hi Jan,
>>
>> On 5/19/2020 5:44 AM, Jan Lahoda wrote:
>>> Hi Vicente,
>>>
>>> javac changes look overall OK to me.
>>>
>>>
>> [snip]
>>
>>
>>> -regarding TypeElement#getPermittedSubclasses: it currently returns
>>> List<? extends TypeMirror>; I wonder if returning List<? extends
>>> TypeElement> would be better?
>>>
>> I did discuss this design point with Vicente ahead of time. While we
>> could probably get away with List<TypeElement> here with the current
>> design, I think List<TypeMirror> is more in keeping with
>> TypeElement.getSuperclass returning a TypeMirror.
>
> Right, I thought the reason was consistency with
> getSuperclass()/getInterfaces(). OTOH using TypeMirror opens up a
> question which TypeMirror should be returned. For getSuperclass(),
> that is obviously the type written in the source code (which can be
> parameterized, raw, etc.) But here, the source code contains more a
> reference to the element (as e.g. in uses/provides directive in
> module-info), so it is not obvious to me how the TypeMirror should
> look like.
The current implementation, using javax.lang.model terminology, is doing
TypeElement.asType() on the elements of the list, which seems reasonable.
-Joe
More information about the compiler-dev
mailing list