Fix IllegalStateException in case of recursive T & Any upper bound
^KT-50542 Fixed
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: +DefinitelyNonNullableTypes
|
||||
|
||||
fun <T : Comparable<T & Any>> sort1() {}
|
||||
fun <T : Comparable<T & Any>?> sort2() {}
|
||||
|
||||
class A1<K : Comparable<K & Any>>
|
||||
class A2<K : Comparable<K & Any>?>
|
||||
|
||||
fun <R : T & Any, T> bar() {}
|
||||
|
||||
fun <E : E & Any> baz() {}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: +DefinitelyNonNullableTypes
|
||||
|
||||
fun <T : <!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>Comparable<T & Any><!>> sort1() {}
|
||||
fun <T : Comparable<T & Any>?> sort2() {}
|
||||
|
||||
class A1<K : Comparable<<!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>K<!> & Any>>
|
||||
class A2<K : Comparable<<!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>K<!> & Any>?>
|
||||
|
||||
fun <R : T & Any, T> bar() {}
|
||||
|
||||
fun <<!CYCLIC_GENERIC_UPPER_BOUND!>E : <!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>E & Any<!><!>> baz() {}
|
||||
compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/recursiveBounds.txt
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ R : T & Any, /*1*/ T> bar(): kotlin.Unit
|
||||
public fun </*0*/ E : [ERROR : Cyclic upper bounds]> baz(): kotlin.Unit
|
||||
public fun </*0*/ T : kotlin.Comparable<T & Any>> sort1(): kotlin.Unit
|
||||
public fun </*0*/ T : kotlin.Comparable<T & Any>?> sort2(): kotlin.Unit
|
||||
|
||||
public final class A1</*0*/ K : kotlin.Comparable<K>> {
|
||||
public constructor A1</*0*/ K : kotlin.Comparable<K>>()
|
||||
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 final class A2</*0*/ K : kotlin.Comparable<K>?> {
|
||||
public constructor A2</*0*/ K : kotlin.Comparable<K>?>()
|
||||
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