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

Vicente Romero vromero at openjdk.org
Wed Nov 15 16:11:45 UTC 2023


> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16668/files
  - new: https://git.openjdk.org/jdk/pull/16668/files/3de50c63..b6ff0235

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16668&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16668&range=00-01

  Stats: 4 lines in 1 file changed: 0 ins; 3 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/16668.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16668/head:pull/16668

PR: https://git.openjdk.org/jdk/pull/16668


More information about the compiler-dev mailing list