// RUN_PIPELINE_TILL: FRONTEND
// DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
// JAVAC_EXPECTED_FILE
// FILE: A.java
import java.util.*;

abstract public class A<T> implements java.util.Collection<T> {
    public boolean containsAll(Collection<?> x) {return false;}
}

// FILE: B.java
import java.util.*;

abstract public class B implements java.util.Collection<String> {
    public boolean containsAll(Collection<?> x) {return false;}
}

// FILE: IC.java
import java.util.*;

public interface IC extends java.util.Collection<String> {
    public boolean containsAll(Collection<?> x);
}

// FILE: main.kt
abstract class KA<T> : java.util.AbstractList<T>() {
    override fun containsAll(x: Collection<T>) = false
}

abstract class KB : java.util.AbstractList<String>(), IC {
    override fun containsAll(elements: Collection<String>) = false
}

fun foo(
        a: A<String>, b: B, ic: IC,
        ka: KA<String>, kb: KB,
        al: java.util.ArrayList<String>,
        cs: Collection<String>, ca: Collection<Any?>
) {
    a.containsAll(cs)
    a.containsAll(<!ARGUMENT_TYPE_MISMATCH!>ca<!>)

    b.containsAll(cs)
    b.containsAll(<!ARGUMENT_TYPE_MISMATCH!>ca<!>)

    ic.containsAll(cs)
    ic.containsAll(<!ARGUMENT_TYPE_MISMATCH!>ca<!>)

    ka.containsAll(cs)
    ka.containsAll(<!ARGUMENT_TYPE_MISMATCH!>ca<!>)

    kb.containsAll(cs)
    kb.containsAll(<!ARGUMENT_TYPE_MISMATCH!>ca<!>)

    al.containsAll(cs)
    al.containsAll(<!ARGUMENT_TYPE_MISMATCH!>ca<!>)
}

/* GENERATED_FIR_TAGS: classDeclaration, functionDeclaration, javaFunction, javaType, nullableType, override,
typeParameter */
