IR: take care of supertypes when copying IrTypeParameters

This commit is contained in:
Georgy Bronnikov
2020-09-08 21:12:49 +03:00
parent 916d66c220
commit 67d7bf3269
14 changed files with 145 additions and 75 deletions
@@ -0,0 +1,21 @@
interface I<TT> {
fun id(x: TT) = x
}
fun <T> forClass(x: T): T {
fun g(z: T): T {
class C : I<T>
return C().id(z)
}
return g(x)
}
fun <T> forTypeParameter(x: T): T {
fun <S : T> h(z: S) = z
return h(x)
}
fun box() = forClass("O") + forTypeParameter("K")