JShell: sealed and final types in jshell

Vicente Romero vicente.romero at oracle.com
Tue May 26 17:44:23 UTC 2020


well actually if we are OK with the patch it doesn't need another review 
in compiler-dev

Vicente

On 5/26/20 8:29 AM, Vicente Romero wrote:
> I'm OK with the change, thanks Jan, I will push it into the sealed 
> types code, for it to be part of the current review.
>
> Thanks,
> Vicente
>
> On 5/20/20 8:00 PM, Robert Field wrote:
>> [adding kulla-dev]
>>
>> "final" is ignored/warning in jshell to allow maximal 
>> experimentation.  But, in retrospect I think that is probably overly 
>> heavy handed.
>>
>> I agree with removing the restriction on "final".
>>
>> Allowing people to explore new language features is one of explicit 
>> goals of jshell -- so supporting sealed types is essential.
>>
>> Side-effect classes which could not be pasted into jshell would be 
>> able to.
>>
>> Variables/methods still should probably not be final.
>>
>> Thoughts?
>>
>> -Robert
>>
>>
>> On 2020-05-20 10:16, Jan Lahoda wrote:
>>> So, I was looking at this today. So far, there are two problems, one 
>>> simple (permitted classes need to be declaration references). The 
>>> second problem is more difficult - if we would like this to work:
>>> sealed class B permits I {}
>>> final class I extends B {}
>>>
>>> we need to allow the "final" modifier, as having:
>>> sealed class B permits I {}
>>> class I extends B {}
>>>
>>> will not work (the class I must either final or non-sealed). Robert, 
>>> what do you think?
>>> ...
>>
>>> I'll continue looking into this tomorrow.
>>>
>>> Jan
>>>
>>> On 19. 05. 20 21:27, Robert Field wrote:
>>>> Absolutely! Absolutely!
>>>>
>>>> Thanks,
>>>> Robert
>>>>
>>>> On 2020-05-19 06:09, Jan Lahoda wrote:
>>>>> Vicente, Robert,
>>>>>
>>>>> Looking at the sealed types, it does not seem support for sealed 
>>>>> has been added to JShell - should that be added? Should I take a 
>>>>> look?
>>>>>
>>>>> Jan
>



More information about the kulla-dev mailing list