Files
kotlin-fork/compiler/testData/diagnostics/tests/functionLiterals/kt4529.fir.kt
T

19 lines
379 B
Kotlin
Vendored

//KT-4529 Lambdas are analyzed improperly in an infix call nested inside a println
class G {
<!INAPPLICABLE_INFIX_MODIFIER!>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