Files
kotlin-fork/compiler/testData/codegen/box/inference/coerctionToUnitForLastExpressionWithStarProjection.kt
T
2021-10-02 06:14:35 +00:00

20 lines
293 B
Kotlin
Vendored

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"
}