Add box test for #KT-43831

This commit is contained in:
Roman Artemev
2021-02-05 17:22:22 +03:00
parent 79f986bb75
commit ca6e1b8f1b
9 changed files with 106 additions and 0 deletions
@@ -14629,6 +14629,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
public void testPropertySetter() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/propertySetter.kt");
}
@Test
@TestMetadata("varianceOverload.kt")
public void testVarianceOverload() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/varianceOverload.kt");
}
}
@Nested
@@ -0,0 +1,63 @@
// MODULE: lib
// FILE: lib.kt
// KT-43831
var result = "FAIL"
class Change : IsChange {
override fun qux(select: RPPG1<out AC1>): IsChange? {
result = ""
return null
}
override fun foo(select: RPPG1<out AC1>, sss: RPPG1<in I1>): Change? {
result += "O"
return null
}
override fun bar(a: RPPG2<out AC1, in AC2<out I2>>, b: RPPG3<in AC1, AC2<in I2>, out AC3<in I2, out I3>>): Change? {
result += "K"
return null
}
}
interface IsChange {
fun qux(select: RPPG1<out AC1>): IsChange?
fun foo(select: RPPG1<out AC1>, sss: RPPG1<in I1>): IsChange?
fun bar(a: RPPG2<out AC1, in AC2<out I2>>, b: RPPG3<in AC1, AC2<in I2>, out AC3<in I2, out I3>>): IsChange?
}
abstract class AC1 : BAC1<Any>()
abstract class AC2<PP1: Any> : BAC2<Any, PP1>()
abstract class AC3<PP1: Any, PP2: Any> : BAC3<Any, PP1, PP2>()
interface I1
interface I2
interface I3
abstract class BAC1<D1 : Any> : I1
abstract class BAC2<D1 : Any, D2: Any> : I2
abstract class BAC3<D1 : Any, D2: Any, D3: kotlin.Any> : I3
class RPPG1<P1 : I1>
class RPPG2<P1 : I1, P2 : I2>
class RPPG3<P1 : I1, P2 : I2, P3 : I3>
// MODULE: main(lib)
// FILE: main.kt
fun box(): String {
val c = Change()
c.qux(RPPG1())
c.foo(RPPG1(), RPPG1())
c.bar(RPPG2(), RPPG3())
return result
}
@@ -14629,6 +14629,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
public void testPropertySetter() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/propertySetter.kt");
}
@Test
@TestMetadata("varianceOverload.kt")
public void testVarianceOverload() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/varianceOverload.kt");
}
}
@Nested
@@ -14629,6 +14629,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
public void testPropertySetter() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/propertySetter.kt");
}
@Test
@TestMetadata("varianceOverload.kt")
public void testVarianceOverload() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/varianceOverload.kt");
}
}
@Nested
@@ -12078,6 +12078,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
public void testPropertySetter() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/propertySetter.kt");
}
@TestMetadata("varianceOverload.kt")
public void testVarianceOverload() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/varianceOverload.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/fieldRename")
@@ -10713,6 +10713,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
public void testPropertySetter() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/propertySetter.kt");
}
@TestMetadata("varianceOverload.kt")
public void testVarianceOverload() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/varianceOverload.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/fieldRename")
@@ -10198,6 +10198,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
public void testPropertySetter() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/propertySetter.kt");
}
@TestMetadata("varianceOverload.kt")
public void testVarianceOverload() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/varianceOverload.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/fieldRename")
@@ -10198,6 +10198,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
public void testPropertySetter() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/propertySetter.kt");
}
@TestMetadata("varianceOverload.kt")
public void testVarianceOverload() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/varianceOverload.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/fieldRename")
@@ -5172,6 +5172,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
public void testPropertySetter() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/propertySetter.kt");
}
@TestMetadata("varianceOverload.kt")
public void testVarianceOverload() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/varianceOverload.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/fieldRename")