// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER fun select(vararg x: T) = x[0] fun id(x: K): K = x fun Unit, K: T> takeSuspend(x: T, y: K) = x fun Unit, K: T> takeSimpleFunction(x: T, y: K) = x fun main() { select(suspend {}, ")!>{}) select(")!>{}, suspend {}) select(")!>id {}, suspend {}) select(")!>id {}, id(suspend {})) select(")!>id {}, id Unit> {}) takeSuspend(")!>id { it }, ")!>{ x -> x }) val x1: suspend (Int) -> Unit = takeSuspend(")!>id { it }, ")!>{ x -> x }) // Here, the error should be val x2: (Int) -> Unit = takeSuspend(")!>id { it }, ")!>{ x -> x }) val x3: suspend (Int) -> Unit = takeSimpleFunction(")!>id { it }, ")!>{ x -> x }) val x4: (Int) -> Unit = takeSimpleFunction(id Unit> {}, ")!>{}) }