diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 5e0bda16e32..8a0d0c21509 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -10244,6 +10244,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT public void testLocalVarNoExplicitType() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/local/localVarNoExplicitType.kt"); } + + @TestMetadata("useReflectionForLocalVarInLambda.kt") + public void testUseReflectionForLocalVarInLambda() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/local/useReflectionForLocalVarInLambda.kt"); + } } @TestMetadata("compiler/testData/codegen/box/delegatedProperty/optimizedDelegatedProperties") diff --git a/compiler/testData/codegen/box/delegatedProperty/local/useReflectionForLocalVarInLambda.kt b/compiler/testData/codegen/box/delegatedProperty/local/useReflectionForLocalVarInLambda.kt new file mode 100644 index 00000000000..401c5c786cb --- /dev/null +++ b/compiler/testData/codegen/box/delegatedProperty/local/useReflectionForLocalVarInLambda.kt @@ -0,0 +1,14 @@ +// TARGET_BACKEND: JVM +// WITH_REFLECT + +import kotlin.reflect.* + +object E + +operator fun E.getValue(receiver: Any?, property: KProperty<*>): String = + if (property.returnType.classifier == String::class) "OK" else "Fail" + +fun box(): String = { + val x: String by E + x +}() diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 907a2b2c3da..4172d32b7cb 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -11639,6 +11639,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testLocalVarNoExplicitType() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/local/localVarNoExplicitType.kt"); } + + @TestMetadata("useReflectionForLocalVarInLambda.kt") + public void testUseReflectionForLocalVarInLambda() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/local/useReflectionForLocalVarInLambda.kt"); + } } @TestMetadata("compiler/testData/codegen/box/delegatedProperty/optimizedDelegatedProperties") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index f28f52e0bf7..b8533277223 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -11639,6 +11639,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testLocalVarNoExplicitType() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/local/localVarNoExplicitType.kt"); } + + @TestMetadata("useReflectionForLocalVarInLambda.kt") + public void testUseReflectionForLocalVarInLambda() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/local/useReflectionForLocalVarInLambda.kt"); + } } @TestMetadata("compiler/testData/codegen/box/delegatedProperty/optimizedDelegatedProperties") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index f1180bede32..86fabe6c11e 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -10244,6 +10244,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testLocalVarNoExplicitType() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/local/localVarNoExplicitType.kt"); } + + @TestMetadata("useReflectionForLocalVarInLambda.kt") + public void testUseReflectionForLocalVarInLambda() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/local/useReflectionForLocalVarInLambda.kt"); + } } @TestMetadata("compiler/testData/codegen/box/delegatedProperty/optimizedDelegatedProperties")