ca12cfb90d
Otherwise, exception from org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector.TypeCheckerStateForConstraintInjector.fixedTypeVariable might happen during forks resolution The test data is extracted from intelliJ FP test ^KT-43296 Fixed
18 lines
667 B
Kotlin
Vendored
18 lines
667 B
Kotlin
Vendored
// SKIP_TXT
|
|
interface Generic<K, V>
|
|
|
|
fun <X, Y> Generic<X, Y>.getValue(x: X): Y = TODO()
|
|
|
|
class MyPair<A, B>(a: A, b: B)
|
|
|
|
fun <E, F> foo(x: Generic<E, F>, e: E, c: Generic<Int, String>): MyPair<F, F> {
|
|
if (c === x && e is Int) {
|
|
bar(MyPair(<!DEBUG_INFO_SMARTCAST!>x<!>.getValue(<!DEBUG_INFO_SMARTCAST!>e<!>), <!DEBUG_INFO_SMARTCAST!>x<!>.getValue(<!DEBUG_INFO_SMARTCAST!>e<!>)))
|
|
return <!TYPE_MISMATCH!>MyPair(<!DEBUG_INFO_SMARTCAST!>x<!>.getValue(<!DEBUG_INFO_SMARTCAST!>e<!>), <!DEBUG_INFO_SMARTCAST!>x<!>.getValue(<!DEBUG_INFO_SMARTCAST!>e<!>))<!>
|
|
}
|
|
|
|
return MyPair(x.getValue(e), x.getValue(e))
|
|
}
|
|
|
|
fun bar(p: MyPair<String, String>) {}
|