Files
kotlin-fork/compiler/testData/diagnostics/tests/functionLiterals/kt4529.kt
T
2020-04-21 09:48:03 +03:00

20 lines
362 B
Kotlin
Vendored

// FIR_IDENTICAL
//KT-4529 Lambdas are analyzed improperly in an infix call nested inside a println
class G {
infix fun foo(bar: (Int) -> Int) = bar
}
fun main() {
use(
G().foo {it + 11} // no error
)
use(
G() foo {it + 11} // ERROR
)
use(
G() foo ({it + 1}) // 2 ERRORs
)
}
fun use(a: Any?) = a