RFR: 8319987: compilation of sealed classes leads to infinite recursion [v2]

Jan Lahoda jlahoda at openjdk.org
Thu Nov 16 11:39:30 UTC 2023


On Wed, 15 Nov 2023 16:11:45 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> The compiler can throw a SOE when trying to compile an incorrect sealed classes hierarchy like:
>> 
>>     sealed interface Action permits Add {}
>>     sealed interface MathOp permits Add {}
>>     sealed static class Add implements MathOp permits Add {}
>> 
>> The error is thrown while trying to prove if two classes are disjoint or not. The proposed solution is to keep a set with the pairs of classes analyzed so far and stop as soon as a the current pair of classes is already in the set.
>> 
>> TIA
>
> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
> 
>   addressing review comments

Looks good to me.

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

Marked as reviewed by jlahoda (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16668#pullrequestreview-1734165208


More information about the compiler-dev mailing list