blob: c3db74b33876322686e9fcd4eb50e6a48a912262 [file]
// RUN_PIPELINE_TILL: CODEGEN
//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
/* GENERATED_FIR_TAGS: additiveExpression, classDeclaration, functionDeclaration, functionalType, infix, integerLiteral,
lambdaLiteral, nullableType */