RFR: 8369654: javac OutOfMemoryError for complex intersection type [v6]
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Oct 31 10:57:14 UTC 2025
On Fri, 31 Oct 2025 05:42:15 GMT, Vicente Romero <vromero at openjdk.org> wrote:
> Note for reviewers: I think that the current solution is incomplete and still incorrect. We need something more complex for the case when both types are non primitive arrays
Also, for context -- yesterday @vicente-romero-oracle and I explored a possible solution that doesn't need go through lub -- after all here we're after finding a common erased supertype between the two types under test. While finding common erased super types is a part of lub (see JLS), lub also does a lot more stuff. In principle the code we need might be as simple as:
List<Type> ec = intersect(erasedSupertypes(t1), erasedSupertypes(t2));
return ec.head
But this simple solution seems to have issues, so additional investigation is required.
@lahodaj am I correct in assuming that the types to be merged in Code are always either class types or array types? E.g. no type variables, intersection types, or other "weird" stuff?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28050#issuecomment-3472502969
More information about the compiler-dev
mailing list