FE: Add test for KT-53656
This commit is contained in:
+6
@@ -11964,6 +11964,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/generics/kt34729.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt53656.kt")
|
||||
public void testKt53656() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/kt53656.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt5508.kt")
|
||||
public void testKt5508() throws Exception {
|
||||
|
||||
+6
@@ -11964,6 +11964,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/generics/kt34729.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt53656.kt")
|
||||
public void testKt53656() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/kt53656.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt5508.kt")
|
||||
public void testKt5508() throws Exception {
|
||||
|
||||
+6
@@ -11964,6 +11964,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/generics/kt34729.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt53656.kt")
|
||||
public void testKt53656() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/kt53656.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt5508.kt")
|
||||
public void testKt5508() throws Exception {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
interface One<T>
|
||||
fun <E, R> foo(): E where E : Number, E : One<R>, R : One<E> = null!!
|
||||
|
||||
interface Entity<T>
|
||||
abstract class SecuredEntity<out E>(val entity: E) where E : Entity<Int>, E : SecurityCodeAware<*,*>
|
||||
interface SecurityCodeAware<out E, R : SecuredEntity<E>> where E : Entity<Int>, E : SecurityCodeAware<E, R>
|
||||
fun <E, R : SecuredEntity<E>> SecurityCodeAware<E, R>.secured() : R where E : Entity<Int>, E : SecurityCodeAware<E, R> = <!RETURN_TYPE_MISMATCH!>when(this) {
|
||||
is Order -> SecuredOrder(this)
|
||||
else -> null!!
|
||||
}<!>
|
||||
class Order : Entity<Int>
|
||||
class SecuredOrder(order: Order) : SecuredEntity<<!UPPER_BOUND_VIOLATED!>Order<!>>(<!ARGUMENT_TYPE_MISMATCH!>order<!>)
|
||||
fun main() {
|
||||
val securedOrder = Order().<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>secured<!>()
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
interface One<T>
|
||||
fun <E, R> foo(): E where E : Number, E : One<R>, R : One<E> = null!!
|
||||
|
||||
interface Entity<T>
|
||||
abstract class SecuredEntity<out E>(val entity: E) where E : Entity<Int>, E : SecurityCodeAware<*,*>
|
||||
interface SecurityCodeAware<out E, R : SecuredEntity<E>> where E : Entity<Int>, E : SecurityCodeAware<E, R>
|
||||
fun <E, R : SecuredEntity<E>> SecurityCodeAware<E, R>.secured() : R where E : Entity<Int>, E : SecurityCodeAware<E, R> = when(this) {
|
||||
is <!INCOMPATIBLE_TYPES!>Order<!> -> <!TYPE_MISMATCH!>SecuredOrder(<!DEBUG_INFO_SMARTCAST!>this<!>)<!>
|
||||
else -> null!!
|
||||
}
|
||||
class Order : Entity<Int>
|
||||
class SecuredOrder(order: Order) : SecuredEntity<<!UPPER_BOUND_VIOLATED!>Order<!>>(order)
|
||||
fun main() {
|
||||
val securedOrder = Order().<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>secured<!>()
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ E : kotlin.Number, /*1*/ R : One<E>> foo(): E where E : One<R>
|
||||
public fun main(): kotlin.Unit
|
||||
public fun </*0*/ E : Entity<kotlin.Int>, /*1*/ R : SecuredEntity<E>> SecurityCodeAware<E, R>.secured(): R where E : SecurityCodeAware<E, R>
|
||||
|
||||
public interface Entity</*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 One</*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 final class Order : Entity<kotlin.Int> {
|
||||
public constructor Order()
|
||||
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 abstract class SecuredEntity</*0*/ out E : Entity<kotlin.Int>> where E : SecurityCodeAware<*, *> {
|
||||
public constructor SecuredEntity</*0*/ out E : Entity<kotlin.Int>>(/*0*/ entity: E) where E : SecurityCodeAware<*, *>
|
||||
public final val entity: E
|
||||
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 SecuredOrder : SecuredEntity<Order> {
|
||||
public constructor SecuredOrder(/*0*/ order: Order)
|
||||
public final override /*1*/ /*fake_override*/ val entity: Order
|
||||
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 SecurityCodeAware</*0*/ out E : Entity<kotlin.Int>, /*1*/ R : SecuredEntity<E>> where E : SecurityCodeAware<E, R> {
|
||||
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
|
||||
}
|
||||
Generated
+6
@@ -11970,6 +11970,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/kt34729.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt53656.kt")
|
||||
public void testKt53656() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/kt53656.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt5508.kt")
|
||||
public void testKt5508() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user