// FIR_IGNORE
// KNM_K2_IGNORE
// should be fixed for FIR, see KT-60764

package test

class SuspendLambda {
    fun <T> (suspend () -> T).createCoroutine1(completion: Continuation<T>) {}

    fun <R, T> (suspend R.() -> T).createCoroutine2(receiver: R, completion: Continuation<T>) {}

    fun <R, T> (suspend @receiver:A R.() -> T).createCoroutineAnother() {}

    fun <T> testCoroutine(f: suspend (Int) -> T?) {}

    fun <T> testCoroutineWithAnnotation(f: suspend (Int) -> @A T?) {}

    var nullableSuspend: (suspend (P) -> Unit)? = null
    var nullableSuspendWithReceiver: (suspend RS.(P) -> Unit)? = null
    var nullableSuspendWithNullableParameter: (suspend (P?) -> Unit)? = null
    var nullableSuspendWithNullableReceiver: (suspend RS?.(P) -> Unit)? = null

    var nullableSuspendWithAnnotation: (@A() suspend (P) -> Unit)? = null

    fun override(p: String, b: (suspend (P) -> Unit)) = null
    fun override(b: (suspend (P) -> Unit)) = null
}

interface P
interface RS

@Target(AnnotationTarget.TYPE, AnnotationTarget.VALUE_PARAMETER)
annotation class A

class Continuation<T> {}