[NI] Update type of complex subcall for last lambda expressions

This commit is contained in:
Mikhail Zarechenskiy
2020-02-25 10:45:21 +03:00
parent 66ef49cecc
commit 5393074d61
11 changed files with 70 additions and 2 deletions
@@ -0,0 +1,20 @@
class Inv<T>
fun Inv<*>.invToInv(): Inv<*>? = null
fun <R> myRun(block: () -> R): R {
return block()
}
fun test(c: Inv<*>) {
myRun {
if (true) return@myRun // coerction to Unit
c.invToInv()?.let {}
}
}
fun box(): String {
test(Inv<Int>())
return "OK"
}