diff --git a/compiler/testData/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt b/compiler/testData/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt new file mode 100644 index 00000000000..cfcaceb9ebc --- /dev/null +++ b/compiler/testData/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt @@ -0,0 +1,25 @@ +// FILE: Var.kt +package pvar + +open class PVar(private var value: T) { + protected operator fun getValue(thisRef: Any?, prop: Any?) = value + + protected operator fun setValue(thisRef: Any?, prop: Any?, newValue: T) { + value = newValue + } +} + +// FILE: test.kt +import pvar.* + +class C : PVar(42L) { + inner class Inner { + var x by this@C + } +} + +fun box(): String { + val inner = C().Inner() + inner.x = 1L + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index a8801ae0325..80800891a98 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -6923,6 +6923,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); } + @TestMetadata("genericSetValueViaSyntheticAccessor.kt") + public void testGenericSetValueViaSyntheticAccessor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt"); + doTest(fileName); + } + @TestMetadata("getAsExtensionFun.kt") public void testGetAsExtensionFun() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 07412989dad..cca5d666cd8 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -6923,6 +6923,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); } + @TestMetadata("genericSetValueViaSyntheticAccessor.kt") + public void testGenericSetValueViaSyntheticAccessor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt"); + doTest(fileName); + } + @TestMetadata("getAsExtensionFun.kt") public void testGetAsExtensionFun() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index b647c12016c..a97ded3eadf 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -6923,6 +6923,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes doTest(fileName); } + @TestMetadata("genericSetValueViaSyntheticAccessor.kt") + public void testGenericSetValueViaSyntheticAccessor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt"); + doTest(fileName); + } + @TestMetadata("getAsExtensionFun.kt") public void testGetAsExtensionFun() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 47403e25b3b..7a0d53e6ca3 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -7619,6 +7619,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); } + @TestMetadata("genericSetValueViaSyntheticAccessor.kt") + public void testGenericSetValueViaSyntheticAccessor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt"); + doTest(fileName); + } + @TestMetadata("getAsExtensionFun.kt") public void testGetAsExtensionFun() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt");