RFR: JDK-8227046: compiler implementation for sealed classes, JDK-8227047: Javadoc for sealed types and JDK-8227044: javax.lang.model for sealed classes

Jan Lahoda jan.lahoda at oracle.com
Thu May 21 12:55:36 UTC 2020


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.

Jan

> 
> Thanks,
> 
> -Joe
> 


More information about the compiler-dev mailing list