Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/specialCallsWithLambdas.kt
T
Denis.Zharkov 0d9ad62d4a Fix inference for lambdas with with extension function expected type
^KT-49832 Fixed
^KT-49836 Fixed
2021-11-26 19:39:51 +03:00

20 lines
384 B
Kotlin
Vendored

// FIR_IDENTICAL
// SKIP_TXT
typealias A = CharSequence.(Int) -> Unit
var w: Int = 1
fun myPrint(x: Int) {}
val a1: A = when (w) {
1 -> { a: Int -> myPrint(a + this.length + 1) }
else -> { a: Int -> myPrint(a + this.length + 2) }
}
val a2: A = try {
{ a: Int -> myPrint(a + this.length + 1) }
} catch (t: Throwable) {
{ a: Int -> myPrint(a + this.length + 2) }
}