resolving several ivars to the same capture?

Stephan Herrmann stephan.herrmann at berlin.de
Thu Oct 23 11:10:55 UTC 2025


Am 23.10.25 um 12:45 schrieb Maurizio Cimadamore:
> On 23/10/2025 11:25, Stephan Herrmann wrote:
>> Doesn't 4.10.2 clearly state that type arguments should be captured here?
> 
> Yes, but that means that we will generate “spurious” capture variables during 
> inference which will end up in the result. Depending on the case, this might 
> result in failures.

define "spurious"! :)


> If this is indeed connected to the spec issue I mentioned above, then I’d say 
> that it’s sad but also sort of ok for the compilers to diverge, given that a 
> “real” fix will in reality be a lot more convoluted than just applying capture.

I understand that changes in this area can easily have big impact, and that 
investigations to curb undesirable impact require a significant investment. On 
the other hand also continuously investigating many issues of similar nature 
causes tremendous efforts over time.

What is the perspective for things to eventually clear up?
* Will Valhalla enter a stage where the type system needs to be improved in ways 
that will include general clarifications of matters of wildcards and captures?
* Otherwise, would it make sense to create a JEP dedicated to such 
clarifications in order to allocate resources required for this task?

I can offer whatever insights can be gained from ecj as a second implementation, 
including experiments what impact certain spec changes might have. I personally 
don't have the full background of type systems sufficient for commenting which 
spec changes might be sound or bogus, but I do have private contact to someone 
who has this background. Perhaps for precise questions I could "mediate" some 
help :)

best,
Stephan


More information about the compiler-dev mailing list