scala3
scala3 copied to clipboard
Attempt to fix performance regression from #20120
Attempts to fix #20120. I'll try to prepare an explanation later today/tomorrow, for now let's see if it will pass CI (it does fix the performance in the minimization) Also, there may be better ways of achieving the same effect (like not producing redundant TypeBounds before committing the typerState, I'll look into this later).
While it currently fails certain tests, it does fix the performance. I'll try to look into why those type bounds are created for intersection types and whether we can fix this by not creating them there, preserving the tests.
It's just a single test that fails, and looking at the history we never really understood why it works now and failed previously. So it's worth digging some more here.
In principle, it would be nice if we could do the improvement in this PR. Or maybe thge weaker form I suggested above:
So maybe one can use a custom mixture of structural comparison of AndTypes and eq comparison for their operands.
Fixed in #20399