K2: add a black box test for KT-58874 to confirm work also in runtime

This commit is contained in:
Mikhail Glukhikh
2023-11-13 22:24:25 +01:00
committed by Space Team
parent ed53d45307
commit f2ef41dbbd
20 changed files with 135 additions and 0 deletions
@@ -15477,6 +15477,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/delegatedProperty/referenceEnclosingClassFieldInReceiver2.kt");
}
@Test
@TestMetadata("resolveGetValueWithWholeDelegate.kt")
public void testResolveGetValueWithWholeDelegate() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/resolveGetValueWithWholeDelegate.kt");
}
@Test
@TestMetadata("setAsExtensionFun.kt")
public void testSetAsExtensionFun() throws Exception {
@@ -15477,6 +15477,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/delegatedProperty/referenceEnclosingClassFieldInReceiver2.kt");
}
@Test
@TestMetadata("resolveGetValueWithWholeDelegate.kt")
public void testResolveGetValueWithWholeDelegate() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/resolveGetValueWithWholeDelegate.kt");
}
@Test
@TestMetadata("setAsExtensionFun.kt")
public void testSetAsExtensionFun() throws Exception {
@@ -15477,6 +15477,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/delegatedProperty/referenceEnclosingClassFieldInReceiver2.kt");
}
@Test
@TestMetadata("resolveGetValueWithWholeDelegate.kt")
public void testResolveGetValueWithWholeDelegate() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/resolveGetValueWithWholeDelegate.kt");
}
@Test
@TestMetadata("setAsExtensionFun.kt")
public void testSetAsExtensionFun() throws Exception {
@@ -0,0 +1,22 @@
// ISSUE: KT-58874
// WITH_STDLIB
import kotlin.reflect.KProperty
class State<S>(var value: S)
operator fun <V> State<V>.getValue(thisRef: Any?, property: KProperty<*>) = value
inline fun <M> remember(block: () -> M): M = block()
// list should have a type of List<Int>, not Any?
val list0 by remember { State(listOf(1)) }
fun expectInt(i: Int) {}
fun box(): String {
val list1 by remember { State(listOf(1)) }
val l0 = list0[0]
expectInt(l0)
val l1 = list1[0]
expectInt(l1)
if (l0 == 1 && l1 == 1) return "OK" else return "$l0$l1"
}
@@ -15111,6 +15111,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/delegatedProperty/referenceEnclosingClassFieldInReceiver2.kt");
}
@Test
@TestMetadata("resolveGetValueWithWholeDelegate.kt")
public void testResolveGetValueWithWholeDelegate() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/resolveGetValueWithWholeDelegate.kt");
}
@Test
@TestMetadata("setAsExtensionFun.kt")
public void testSetAsExtensionFun() throws Exception {
@@ -15477,6 +15477,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/delegatedProperty/referenceEnclosingClassFieldInReceiver2.kt");
}
@Test
@TestMetadata("resolveGetValueWithWholeDelegate.kt")
public void testResolveGetValueWithWholeDelegate() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/resolveGetValueWithWholeDelegate.kt");
}
@Test
@TestMetadata("setAsExtensionFun.kt")
public void testSetAsExtensionFun() throws Exception {
@@ -15477,6 +15477,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/delegatedProperty/referenceEnclosingClassFieldInReceiver2.kt");
}
@Test
@TestMetadata("resolveGetValueWithWholeDelegate.kt")
public void testResolveGetValueWithWholeDelegate() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/resolveGetValueWithWholeDelegate.kt");
}
@Test
@TestMetadata("setAsExtensionFun.kt")
public void testSetAsExtensionFun() throws Exception {
@@ -12703,6 +12703,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/delegatedProperty/referenceEnclosingClassFieldInReceiver2.kt");
}
@TestMetadata("resolveGetValueWithWholeDelegate.kt")
public void testResolveGetValueWithWholeDelegate() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/resolveGetValueWithWholeDelegate.kt");
}
@TestMetadata("setAsExtensionFun.kt")
public void testSetAsExtensionFun() throws Exception {
runTest("compiler/testData/codegen/box/delegatedProperty/setAsExtensionFun.kt");