Do subtyping between self types with captured type in special way

This commit is contained in:
Victor Petukhov
2021-03-24 15:30:16 +03:00
parent 7f2c5cde55
commit bbf5c4412e
14 changed files with 185 additions and 11 deletions
@@ -0,0 +1,8 @@
// WITH_RUNTIME
// !DIAGNOSTICS: -UNUSED_VARIABLE
class Foo<T : Enum<T>>(val values: Array<T>)
fun foo(x: Array<out Enum<*>>) {
val y = <!INAPPLICABLE_CANDIDATE!>Foo<!>(x)
}
@@ -0,0 +1,8 @@
// WITH_RUNTIME
// !DIAGNOSTICS: -UNUSED_VARIABLE
class Foo<T : Enum<T>>(val values: Array<T>)
fun foo(x: Array<out Enum<*>>) {
val y = Foo(x)
}
@@ -0,0 +1,11 @@
package
public fun foo(/*0*/ x: kotlin.Array<out kotlin.Enum<*>>): kotlin.Unit
public final class Foo</*0*/ T : kotlin.Enum<T>> {
public constructor Foo</*0*/ T : kotlin.Enum<T>>(/*0*/ values: kotlin.Array<T>)
public final val values: kotlin.Array<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
}