// RUN_PIPELINE_TILL: FRONTEND
// DIAGNOSTICS: -UNUSED_PARAMETER

interface G<T> {
    fun build(): G<T>
}
class V1<V>(val value: V)
class V2<V>(val value: V)
fun <V, T : V?> G<T>.foo(vararg values: V1<V>) = build()
fun <V, T : V?> G<T>.foo(vararg values: V2<V?>) = build()

fun forReference(ref: Any?) {}

fun test() {
    forReference(G<Int?>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>)
}

/* GENERATED_FIR_TAGS: classDeclaration, funWithExtensionReceiver, functionDeclaration, interfaceDeclaration,
nullableType, primaryConstructor, propertyDeclaration, typeConstraint, typeParameter, vararg */
