[NI] Add test for KT-30300 with complex constraint system problem
This commit is contained in:
+5
@@ -9961,6 +9961,11 @@ public class FirDiagnosticsSmokeTestGenerated extends AbstractFirDiagnosticsSmok
|
||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt30300.kt")
|
||||
public void testKt30300() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt3372toCollection.kt")
|
||||
public void testKt3372toCollection() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// Issue: KT-30300
|
||||
|
||||
class Inv<T>
|
||||
class InvOut<T, out K>
|
||||
|
||||
class Sample
|
||||
|
||||
fun <T> select(x: T, y: T): T = x
|
||||
fun <K1, V1> selectInvOut(a: InvOut<out K1, V1>, b: InvOut<out K1, V1>): InvOut<K1, V1> = TODO()
|
||||
fun <K2, V2> emptyInvOut(): InvOut<K2, V2> = TODO()
|
||||
fun <S> create(element: S): InvOut<Inv<S>, S> = TODO()
|
||||
|
||||
fun test(s: Sample, b: InvOut<Inv<*>, Any?>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("InvOut<Inv<*>, kotlin.Any?>")!>selectInvOut(
|
||||
b,
|
||||
select(create(s), emptyInvOut())
|
||||
)<!>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ S> create(/*0*/ element: S): InvOut<Inv<S>, S>
|
||||
public fun </*0*/ K2, /*1*/ V2> emptyInvOut(): InvOut<K2, V2>
|
||||
public fun </*0*/ T> select(/*0*/ x: T, /*1*/ y: T): T
|
||||
public fun </*0*/ K1, /*1*/ V1> selectInvOut(/*0*/ a: InvOut<out K1, V1>, /*1*/ b: InvOut<out K1, V1>): InvOut<K1, V1>
|
||||
public fun test(/*0*/ s: Sample, /*1*/ b: InvOut<Inv<*>, kotlin.Any?>): kotlin.Unit
|
||||
|
||||
public final class Inv</*0*/ T> {
|
||||
public constructor Inv</*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 InvOut</*0*/ T, /*1*/ out K> {
|
||||
public constructor InvOut</*0*/ T, /*1*/ out 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 Sample {
|
||||
public constructor Sample()
|
||||
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
|
||||
}
|
||||
@@ -9968,6 +9968,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt30300.kt")
|
||||
public void testKt30300() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt3372toCollection.kt")
|
||||
public void testKt3372toCollection() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");
|
||||
|
||||
Generated
+5
@@ -9963,6 +9963,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt30300.kt")
|
||||
public void testKt30300() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt3372toCollection.kt")
|
||||
public void testKt3372toCollection() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");
|
||||
|
||||
Reference in New Issue
Block a user