Files
kotlin-fork/compiler/testData/diagnostics/tests/functionLiterals/kt4529.kt
T
2014-02-12 14:47:10 +04:00

19 lines
358 B
Kotlin

//KT-4529 Lambdas are analyzed improperly in an infix call nested inside a println
class G {
fun foo(bar: (Int) -> Int) = bar
}
fun main(args: Array<String>) {
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