K2: Add test data for KT-64841 showing its current state

This commit is contained in:
Denis.Zharkov
2024-01-23 12:55:31 +01:00
committed by Space Team
parent 3024ec3da3
commit 81d559ad7f
9 changed files with 114 additions and 0 deletions
@@ -0,0 +1,21 @@
// ISSUE: KT-64841
open class A<X : A<X>>(a: Any?) {
// Constraints while resolving super constructor call
//
// The signature of constructor comes substituted
// constructor<X : R|A<A.B<X>>|>(a: R|kotlin/Any?|): R|A<A.B<X>>|
//
// Xv <: A<A<Xv>.B> (from type parameter bounds, actually it's the incorrect place)
//
// Xv := A<X>.B (from explicit type argument of constructor call)
// A<X>.B> <: A<A<Xv>.B>
// A<A<X>.B> <: A<A<Xv>.B>
// Xv := X
// X != A<X>.B -> FAIL
inner class B : A<B>(<!ARGUMENT_TYPE_MISMATCH!>""<!>) {
fun foo() {
A<B>("")
}
}
}
@@ -0,0 +1,21 @@
// ISSUE: KT-64841
open class A<X : A<X>>(a: Any?) {
// Constraints while resolving super constructor call
//
// The signature of constructor comes substituted
// constructor<X : R|A<A.B<X>>|>(a: R|kotlin/Any?|): R|A<A.B<X>>|
//
// Xv <: A<A<Xv>.B> (from type parameter bounds, actually it's the incorrect place)
//
// Xv := A<X>.B (from explicit type argument of constructor call)
// A<X>.B> <: A<A<Xv>.B>
// A<A<X>.B> <: A<A<Xv>.B>
// Xv := X
// X != A<X>.B -> FAIL
inner class B : A<B>("") {
fun foo() {
A<B>("")
}
}
}
@@ -0,0 +1,6 @@
// ISSUE: KT-64841
abstract class A<X, Y : A<X, Y>>
abstract class B<X, T, Y : B<X, T, Y>>(delegate: A<X, *>) : A<X, Y>() {
inner class C<R> : B<X, R, C<R>>(<!ARGUMENT_TYPE_MISMATCH!>this<!>)
}
@@ -0,0 +1,6 @@
// ISSUE: KT-64841
abstract class A<X, Y : A<X, Y>>
abstract class B<X, T, Y : B<X, T, Y>>(delegate: A<X, *>) : A<X, Y>() {
inner class C<R> : B<X, R, C<R>>(this)
}