K2: Do not fix variables that has yet unprocessed constraints in forks
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
This commit is contained in:
committed by
Space Team
parent
b73acd7a3a
commit
ca12cfb90d
+17
@@ -0,0 +1,17 @@
|
||||
// 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>) {}
|
||||
Reference in New Issue
Block a user