On Fri, 4 Jun 2021 18:23:28 GMT, Vicente Romero <vrom...@openjdk.org> wrote:

>> Jan Lahoda has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Fixing typo.
>
> test/langtools/tools/javac/patterns/SealedTypeChanges.java line 71:
> 
>> 69: }
>> 70: 
>> 71: sealed interface SealedTypeChangesIntf permits SealedTypeChanges.A {}
> 
> just for completeness shouldn't we have a test with sealed, non-abstract 
> classes?

Note that for sealed non-abstract classes, the permits is not checked (as an 
instance of the non-abstract class may be created and passed to the switch, the 
switch needs to contain a case that will cover the class anyway). I've added 
tests that check the behavior for abstract class, and non-abstract classes 
(error is produced in the latter case).

-------------

PR: https://git.openjdk.java.net/jdk/pull/3863

Reply via email to