<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
FWIW There’s extensive research on the complexity of similar type inference problems. For example, the essence of the ML type inference problem (this is the one that inspired most similar "type inference in the presence of generic types" problems, including
 Java’s) was shown to be doubly-exponential (yikes!) although in most cases that can be cut down a lot. Here's an interesting survey article if you want to learn more:
<div><br>
</div>
<div><a href="http://gallium.inria.fr/~fpottier/publis/emlti-final.pdf">http://gallium.inria.fr/~fpottier/publis/emlti-final.pdf</a><br id="lineBreakAtBeginningOfMessage">
<div><br>
</div>
<div>Gavin</div>
<div><br>
</div>
<div><br>
<blockquote type="cite">
<div>On 21 Jan 2025, at 12:38, Dawid Weiss <dawid.weiss@gmail.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div>
<blockquote type="cite">This is a performance problem for IntelliJ as well. Highlighting becomes slow on such code. Not sure whether it's slower or faster than javac, but it's definitely slow. So technically, it's 'javac + IntelliJ quirks' :-)<br>
</blockquote>
<br>
I can add ecj to this: "javac" + "intellij" + "Eclipse ecj" quirks<br>
because I've tried out of curiosity and ecj also grinds to a halt on<br>
this pattern.<br>
<br>
Oh well, thanks for the interesting discussion. I've learnt something new.<br>
<br>
Dawid<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>