diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt new file mode 100644 index 00000000000..27510e97eba --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt @@ -0,0 +1,20 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME +import kotlin.test.assertEquals + +inline class Z(internal val x: Int) +inline class L(internal val x: Long) +inline class S(internal val x: String) + +fun box(): String { + assertEquals(42, Z::x.get(Z(42))) + assertEquals(1234L, L::x.get(L(1234L))) + assertEquals("abc", S::x.get(S("abc"))) + + assertEquals(42, Z::x.invoke(Z(42))) + assertEquals(1234L, L::x.invoke(L(1234L))) + assertEquals("abc", S::x.invoke(S("abc"))) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt new file mode 100644 index 00000000000..500b78cd9c1 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt @@ -0,0 +1,34 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME +import kotlin.test.assertEquals + +inline class Z(private val x: Int) { + companion object { + val xref = Z::x + } +} + +inline class L(private val x: Long) { + companion object { + val xref = L::x + } +} + +inline class S(private val x: String) { + companion object { + val xref = S::x + } +} + +fun box(): String { + assertEquals(42, Z.xref.get(Z(42))) + assertEquals(1234L, L.xref.get(L(1234L))) + assertEquals("abc", S.xref.get(S("abc"))) + + assertEquals(42, Z.xref.invoke(Z(42))) + assertEquals(1234L, L.xref.invoke(L(1234L))) + assertEquals("abc", S.xref.invoke(S("abc"))) + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index cedb78a1aaf..416cb01e815 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -12081,6 +12081,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); } + @TestMetadata("inlineClassInternalPrimaryVal.kt") + public void testInlineClassInternalPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt"); + } + @TestMetadata("inlineClassMemberFun.kt") public void testInlineClassMemberFun() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); @@ -12101,6 +12106,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); } + @TestMetadata("inlineClassPrivatePrimaryVal.kt") + public void testInlineClassPrivatePrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt"); + } + @TestMetadata("inlineClassTypeBoundMemberVar.kt") public void testInlineClassTypeBoundMemberVar() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index bfb7be96f47..8a05c8e35e3 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -12081,6 +12081,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); } + @TestMetadata("inlineClassInternalPrimaryVal.kt") + public void testInlineClassInternalPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt"); + } + @TestMetadata("inlineClassMemberFun.kt") public void testInlineClassMemberFun() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); @@ -12101,6 +12106,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); } + @TestMetadata("inlineClassPrivatePrimaryVal.kt") + public void testInlineClassPrivatePrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt"); + } + @TestMetadata("inlineClassTypeBoundMemberVar.kt") public void testInlineClassTypeBoundMemberVar() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 0593bf38216..0b1546e7726 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -12086,6 +12086,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); } + @TestMetadata("inlineClassInternalPrimaryVal.kt") + public void testInlineClassInternalPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt"); + } + @TestMetadata("inlineClassMemberFun.kt") public void testInlineClassMemberFun() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); @@ -12106,6 +12111,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); } + @TestMetadata("inlineClassPrivatePrimaryVal.kt") + public void testInlineClassPrivatePrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt"); + } + @TestMetadata("inlineClassTypeBoundMemberVar.kt") public void testInlineClassTypeBoundMemberVar() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java index 8fdbc0ed0f4..b4cf1644689 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java @@ -10601,6 +10601,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); } + @TestMetadata("inlineClassInternalPrimaryVal.kt") + public void testInlineClassInternalPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt"); + } + @TestMetadata("inlineClassMemberFun.kt") public void testInlineClassMemberFun() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); @@ -10621,6 +10626,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); } + @TestMetadata("inlineClassPrivatePrimaryVal.kt") + public void testInlineClassPrivatePrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt"); + } + @TestMetadata("inlineClassTypeBoundMemberVar.kt") public void testInlineClassTypeBoundMemberVar() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.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 a37cc2010b8..3199698e72d 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 @@ -11646,6 +11646,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); } + @TestMetadata("inlineClassInternalPrimaryVal.kt") + public void testInlineClassInternalPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt"); + } + @TestMetadata("inlineClassMemberFun.kt") public void testInlineClassMemberFun() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); @@ -11666,6 +11671,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); } + @TestMetadata("inlineClassPrivatePrimaryVal.kt") + public void testInlineClassPrivatePrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt"); + } + @TestMetadata("inlineClassTypeBoundMemberVar.kt") public void testInlineClassTypeBoundMemberVar() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt");