Possible bug with multiple generic bounds

Dan Smith daniel.smith at oracle.com
Wed Aug 20 15:52:20 UTC 2025


For some context, there's a longstanding known issue that the interaction between intersections and wildcards is under-specified. Deciding which intersections are well-formed, and if so what are the types of their members, is a deep problem without easy answers.

JDK-7034922 captures some of the issues, and I see this bug has been linked to it.

So yes, this is intuitively a bug, but the problem is we don't have a specification to conform to, and it's not clear what that specification should say.

I've done some work in the past to try to make sense of the intended type system, but that work hasn't gotten to the point of actionable changes. In the mean time I think this is just one more test case for these features that we can keep track of.



More information about the compiler-dev mailing list