FIR: Implement captured type substitution

This commit is contained in:
Simon Ogorodnik
2021-11-15 16:37:34 +03:00
committed by teamcity
parent 476a7727da
commit 61ea65906c
6 changed files with 23 additions and 16 deletions
@@ -1,12 +0,0 @@
// !DIAGNOSTICS: -CAST_NEVER_SUCCEEDS -UNUSED_PARAMETER
class Foo<K>
fun <T> getFoo(value: T) = null as Foo<out Foo<T>>
fun <R> takeLambda(block: () -> R) {}
fun main(x: Int) {
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>takeLambda<!> {
getFoo(x)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -CAST_NEVER_SUCCEEDS -UNUSED_PARAMETER
class Foo<K>
@@ -82,7 +82,7 @@ fun testCapturedVariable() {
c2
val c3 = select(SubInv<Number>(), createInvIn())
val c3 = <!NEW_INFERENCE_ERROR!>select(SubInv<Number>(), createInvIn())<!>
c3
}
@@ -57,7 +57,7 @@ fun test7(cls: Cls) {
}
fun test8(cls: Cls) {
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>id<!>(
id(
wrapIn(cls)
)
}