Remove uncapturing in type mismatch diagnostics
#KT-32587 Fixed
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class X {
|
||||
abstract class Y<T : Any>
|
||||
|
||||
fun <T : Any> foo(y: Y<T>, t: T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun testStar(y: X.Y<*>, t: Any) {
|
||||
X().foo(y, <!TYPE_MISMATCH("CapturedType(*)", "Any")!>t<!>)
|
||||
}
|
||||
|
||||
fun testOut(y: X.Y<out Any>, t: Any) {
|
||||
X().foo(y, <!TYPE_MISMATCH("CapturedType(out Any)", "Any")!>t<!>)
|
||||
}
|
||||
|
||||
fun testIn(y: X.Y<in Any>, t: Any) {
|
||||
X().foo(y, t)
|
||||
}
|
||||
|
||||
fun <T : Any> testWithParameter(y: X.Y<T>, t: Any) {
|
||||
X().foo(y, <!TYPE_MISMATCH("T", "Any")!>t<!>)
|
||||
}
|
||||
|
||||
fun <T : Any> testWithCapturedParameter(y: X.Y<out T>, t: Any) {
|
||||
X().foo(y, <!TYPE_MISMATCH("CapturedType(out T)", "Any")!>t<!>)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package
|
||||
|
||||
public fun testIn(/*0*/ y: X.Y<in kotlin.Any>, /*1*/ t: kotlin.Any): kotlin.Unit
|
||||
public fun testOut(/*0*/ y: X.Y<out kotlin.Any>, /*1*/ t: kotlin.Any): kotlin.Unit
|
||||
public fun testStar(/*0*/ y: X.Y<*>, /*1*/ t: kotlin.Any): kotlin.Unit
|
||||
public fun </*0*/ T : kotlin.Any> testWithCapturedParameter(/*0*/ y: X.Y<out T>, /*1*/ t: kotlin.Any): kotlin.Unit
|
||||
public fun </*0*/ T : kotlin.Any> testWithParameter(/*0*/ y: X.Y<T>, /*1*/ t: kotlin.Any): kotlin.Unit
|
||||
|
||||
public final class X {
|
||||
public constructor X()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun </*0*/ T : kotlin.Any> foo(/*0*/ y: X.Y<T>, /*1*/ t: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public abstract class Y</*0*/ T : kotlin.Any> {
|
||||
public constructor Y</*0*/ T : kotlin.Any>()
|
||||
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