diff --git a/compiler/testData/codegen/boxWithJava/reflection/javaPropertyInheritedInKotlin/J.java b/compiler/testData/codegen/boxWithJava/reflection/javaPropertyInheritedInKotlin/J.java new file mode 100644 index 00000000000..e852bb0bc83 --- /dev/null +++ b/compiler/testData/codegen/boxWithJava/reflection/javaPropertyInheritedInKotlin/J.java @@ -0,0 +1,3 @@ +public class J { + public String result = null; +} diff --git a/compiler/testData/codegen/boxWithJava/reflection/javaPropertyInheritedInKotlin/K.kt b/compiler/testData/codegen/boxWithJava/reflection/javaPropertyInheritedInKotlin/K.kt new file mode 100644 index 00000000000..3baf0015d15 --- /dev/null +++ b/compiler/testData/codegen/boxWithJava/reflection/javaPropertyInheritedInKotlin/K.kt @@ -0,0 +1,9 @@ +class K : J() + +fun box(): String { + val k = K() + val p = K::result + if (p.get(k) != null) return "Fail" + p.set(k, "OK") + return p.get(k) +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java index 1b385637e0b..9e273ec9813 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java @@ -174,6 +174,12 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithJava/reflection"), Pattern.compile("^([^\\.]+)$"), true); } + @TestMetadata("javaPropertyInheritedInKotlin") + public void testJavaPropertyInheritedInKotlin() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/reflection/javaPropertyInheritedInKotlin/"); + doTestWithJava(fileName); + } + @TestMetadata("kotlinPropertyInheritedInJava") public void testKotlinPropertyInheritedInJava() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/reflection/kotlinPropertyInheritedInJava/");