Fix KT-10472: compare all overloads including varargs in a single pass.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
object Right
|
||||
object Wrong
|
||||
|
||||
interface A<T>
|
||||
interface B<T> : A<T>
|
||||
|
||||
fun <T> foo(vararg t: T) = Wrong
|
||||
fun <T> foo(t: A<T>) = Wrong
|
||||
fun <T> foo(t: B<T>) = Right
|
||||
|
||||
fun test(b: B<Int>): Right = foo(b)
|
||||
@@ -0,0 +1,32 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> foo(/*0*/ t: A<T>): Wrong
|
||||
public fun </*0*/ T> foo(/*0*/ t: B<T>): Right
|
||||
public fun </*0*/ T> foo(/*0*/ vararg t: T /*kotlin.Array<out T>*/): Wrong
|
||||
public fun test(/*0*/ b: B<kotlin.Int>): Right
|
||||
|
||||
public interface A</*0*/ T> {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface B</*0*/ T> : A<T> {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public object Right {
|
||||
private constructor Right()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public object Wrong {
|
||||
private constructor Wrong()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user