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
@@ -15536,6 +15536,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
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 {
@@ -15536,6 +15536,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
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 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");
@@ -11553,6 +11553,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
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 {
@@ -11553,6 +11553,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
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 {
@@ -11553,6 +11553,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
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 {
@@ -11553,6 +11553,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
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 {
@@ -12572,6 +12572,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
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 {
@@ -12862,6 +12862,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
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 {
@@ -12428,6 +12428,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
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 {
@@ -12573,6 +12573,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
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 {
@@ -11529,6 +11529,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes
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 {
@@ -11529,6 +11529,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest
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 {