|
| 1 | +class P[X, Y] |
| 2 | + |
| 3 | +type Swap[X] = X match |
| 4 | + case P[x, y] => Swap[P[y, x]] |
| 5 | + |
| 6 | +val z: P[String, Int] = ??? : Swap[P[Int, String]] // error |
| 7 | +// ^ |
| 8 | +// Recursion limit exceeded. |
| 9 | +// Maybe there is an illegal cyclic reference? |
| 10 | +// If that's not the case, you could also try to increase the stacksize using the -Xss JVM option. |
| 11 | +// A recurring operation is (inner to outer): |
| 12 | +// |
| 13 | +// normalizing P[String, Int] match ... |
| 14 | +// normalizing P[Int, String] match ... |
| 15 | +// normalizing P[String, Int] match ... |
| 16 | +// normalizing P[Int, String] match ... |
| 17 | +// normalizing P[String, Int] match ... |
| 18 | +// normalizing P[Int, String] match ... |
| 19 | +// normalizing P[String, Int] match ... |
| 20 | +// normalizing P[Int, String] match ... |
| 21 | +// normalizing P[String, Int] match ... |
| 22 | +// normalizing P[Int, String] match ... |
| 23 | +// ... |
| 24 | +// |
| 25 | +// normalizing P[String, Int] match ... |
| 26 | +// normalizing P[Int, String] match ... |
| 27 | +// normalizing P[String, Int] match ... |
| 28 | +// normalizing P[Int, String] match ... |
| 29 | +// normalizing P[String, Int] match ... |
| 30 | +// normalizing P[Int, String] match ... |
| 31 | +// normalizing P[String, Int] match ... |
| 32 | +// normalizing P[Int, String] match ... |
| 33 | +// normalizing P[String, Int] match ... |
| 34 | +// normalizing P[Int, String] match ... |
0 commit comments