Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/constraints/kt6320.fir.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

21 lines
489 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_VARIABLE
// AssertionError in ConstraintSystem(The constraint shouldn't contain different type variables on both sides: Y <: X)
class A<X, Y : X>
class B<X, Y : X>(foo: A<X, Y>) {
fun test1(a: A<X, Y>) {
B(a)
val b: B<X, Y> = B(a)
// crash here
}
}
class C<X, Z, Y : X>
class D<X, Z, Y : X>(foo: C<X, Z, Y>) {
fun test(a: C<Y, Y, Y>) {
val d: D<X, Y, Y> = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>D(a)<!>
}
}