// RUN_PIPELINE_TILL: BACKEND
// FIR_IDENTICAL
interface In<in I>

interface B : In<B>

interface C<I, T>

fun <I, T> In<I>.foo(f: () -> C<I, T>) {}
fun <I, T, Self: In<I>> Self.foo2(f: () -> C<I, T>) {}

class E : B // e <: In<B> <: In<E>

fun test(c: C<E, Int>, e: E) {
    e.foo<E, Int> { c }
    e.foo { c } // error here: expected C<B, ???> but must be C<??? : B, ???>
    e.foo2 { c }
    e.foo2 ({ c })
}

/* GENERATED_FIR_TAGS: classDeclaration, funWithExtensionReceiver, functionDeclaration, functionalType, in,
interfaceDeclaration, lambdaLiteral, nullableType, typeConstraint, typeParameter */
