Closed
Description
class P[X, Y]
type Swap[X] = X match
case P[x, y] => Swap[P[y, x]]
val z: P[String, Int] = ??? : Swap[P[Int, String]]
The compiler seems to hang when compiling the last line.
Expectation
The compiler should either report a stack overflow or detect the diverging expansion statically. My preference would be to try static divergence detection first. @milessabin implemented state of the art techniques for detecting divergent implicit searches - it seems that these techniques are transferable.