From 3dc4d01adcd2d4dcb64c849aabcf7556214ffda2 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Thu, 4 Oct 2018 15:42:38 +0300 Subject: [PATCH] Tests for callable references and inline classes --- .../boundInlineClassExtensionFun.kt | 19 ++++ .../boundInlineClassExtensionVal.kt | 19 ++++ .../boundInlineClassMemberFun.kt | 23 +++++ .../boundInlineClassMemberVal.kt | 23 +++++ .../boundInlineClassPrimaryVal.kt | 15 ++++ .../funWithInlineClassParameters.kt | 15 ++++ .../inlineClassExtensionFun.kt | 19 ++++ .../inlineClassExtensionVal.kt | 19 ++++ .../inlineClassMemberFun.kt | 23 +++++ .../inlineClassMemberVal.kt | 23 +++++ .../inlineClassPrimaryConstructor.kt | 15 ++++ .../inlineClassPrimaryVal.kt | 15 ++++ .../inlineClassTypeBoundMemberVar.kt | 19 ++++ .../inlineClassTypeMemberVar.kt | 19 ++++ .../inlineClassTypeTopLevelVar.kt | 17 ++++ .../codegen/BlackBoxCodegenTestGenerated.java | 88 +++++++++++++++++++ .../LightAnalysisModeTestGenerated.java | 88 +++++++++++++++++++ .../ir/IrBlackBoxCodegenTestGenerated.java | 88 +++++++++++++++++++ .../IrJsCodegenBoxTestGenerated.java | 88 +++++++++++++++++++ .../semantics/JsCodegenBoxTestGenerated.java | 88 +++++++++++++++++++ 20 files changed, 723 insertions(+) create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt new file mode 100644 index 00000000000..55ae07edfe2 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt @@ -0,0 +1,19 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) +inline class L(val x: Long) +inline class S(val x: String) + +fun Z.test() = x +fun L.test() = x +fun S.test() = x + +fun box(): String { + if (Z(42)::test.invoke() != 42) throw AssertionError() + if (L(1234L)::test.invoke() != 1234L) throw AssertionError() + if (S("abcdef")::test.invoke() != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt new file mode 100644 index 00000000000..a84baaa539b --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt @@ -0,0 +1,19 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) +inline class L(val x: Long) +inline class S(val x: String) + +val Z.xx get() = x +val L.xx get() = x +val S.xx get() = x + +fun box(): String { + if (Z(42)::xx.get() != 42) throw AssertionError() + if (L(1234L)::xx.get() != 1234L) throw AssertionError() + if (S("abcdef")::xx.get() != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt new file mode 100644 index 00000000000..27ddb7be5fc --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt @@ -0,0 +1,23 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) { + fun test() = x +} + +inline class L(val x: Long) { + fun test() = x +} + +inline class S(val x: String) { + fun test() = x +} + +fun box(): String { + if (Z(42)::test.invoke() != 42) throw AssertionError() + if (L(1234L)::test.invoke() != 1234L) throw AssertionError() + if (S("abcdef")::test.invoke() != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt new file mode 100644 index 00000000000..8f1082ae0e4 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt @@ -0,0 +1,23 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) { + val xx get() = x +} + +inline class L(val x: Long) { + val xx get() = x +} + +inline class S(val x: String) { + val xx get() = x +} + +fun box(): String { + if (Z(42)::xx.get() != 42) throw AssertionError() + if (L(1234L)::xx.get() != 1234L) throw AssertionError() + if (S("abcdef")::xx.get() != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt new file mode 100644 index 00000000000..e16695775da --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt @@ -0,0 +1,15 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) +inline class L(val x: Long) +inline class S(val x: String) + +fun box(): String { + if (Z(42)::x.get() != 42) throw AssertionError() + if (L(1234L)::x.get() != 1234L) throw AssertionError() + if (S("abcdef")::x.get() != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt new file mode 100644 index 00000000000..19e2e183a7a --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt @@ -0,0 +1,15 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) +inline class L(val x: Long) +inline class S(val x: String) + +fun test(aZ: Z, aL: L, aS: S) = "${aZ.x} ${aL.x} ${aS.x}" + +fun box(): String { + if (::test.invoke(Z(1), L(1L), S("abc")) != "1 1 abc") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt new file mode 100644 index 00000000000..b14d3d019f3 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt @@ -0,0 +1,19 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) +inline class L(val x: Long) +inline class S(val x: String) + +fun Z.test() = x +fun L.test() = x +fun S.test() = x + +fun box(): String { + if (Z::test.invoke(Z(42)) != 42) throw AssertionError() + if (L::test.invoke(L(1234L)) != 1234L) throw AssertionError() + if (S::test.invoke(S("abcdef")) != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt new file mode 100644 index 00000000000..9ed52b69c81 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt @@ -0,0 +1,19 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) +inline class L(val x: Long) +inline class S(val x: String) + +val Z.xx get() = x +val L.xx get() = x +val S.xx get() = x + +fun box(): String { + if ((Z::xx).get(Z(42)) != 42) throw AssertionError() + if ((L::xx).get(L(1234L)) != 1234L) throw AssertionError() + if ((S::xx).get(S("abcdef")) != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt new file mode 100644 index 00000000000..f04d0ee8a6c --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt @@ -0,0 +1,23 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) { + fun test() = x +} + +inline class L(val x: Long) { + fun test() = x +} + +inline class S(val x: String) { + fun test() = x +} + +fun box(): String { + if (Z::test.invoke(Z(42)) != 42) throw AssertionError() + if (L::test.invoke(L(1234L)) != 1234L) throw AssertionError() + if (S::test.invoke(S("abcdef")) != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt new file mode 100644 index 00000000000..28d6c0c1d79 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt @@ -0,0 +1,23 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) { + val xx get() = x +} + +inline class L(val x: Long) { + val xx get() = x +} + +inline class S(val x: String) { + val xx get() = x +} + +fun box(): String { + if ((Z::xx).get(Z(42)) != 42) throw AssertionError() + if ((L::xx).get(L(1234L)) != 1234L) throw AssertionError() + if ((S::xx).get(S("abcdef")) != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt new file mode 100644 index 00000000000..107b783d102 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt @@ -0,0 +1,15 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) +inline class L(val x: Long) +inline class S(val x: String) + +fun box(): String { + if (42.let(::Z).x != 42) throw AssertionError() + if (1234L.let(::L).x != 1234L) throw AssertionError() + if ("abcdef".let(::S).x != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt new file mode 100644 index 00000000000..d6dc1a822ab --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt @@ -0,0 +1,15 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +inline class Z(val x: Int) +inline class L(val x: Long) +inline class S(val x: String) + +fun box(): String { + if ((Z::x).get(Z(42)) != 42) throw AssertionError() + if ((L::x).get(L(1234L)) != 1234L) throw AssertionError() + if ((S::x).get(S("abcdef")) != "abcdef") throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt new file mode 100644 index 00000000000..0cb8cb16035 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt @@ -0,0 +1,19 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME +inline class Z(val x: Int) + +class C(var z: Z) + +fun box(): String { + val x = C(Z(42)) + + val ref = x::z + + if (ref.get().x != 42) throw AssertionError() + + ref.set(Z(1234)) + if (ref.get().x != 1234) throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt new file mode 100644 index 00000000000..5e135942f76 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt @@ -0,0 +1,19 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME +inline class Z(val x: Int) + +class C(var z: Z) + +fun box(): String { + val ref = C::z + + val x = C(Z(42)) + + if (ref.get(x).x != 42) throw AssertionError() + + ref.set(x, Z(1234)) + if (ref.get(x).x != 1234) throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt new file mode 100644 index 00000000000..3d99a9de3db --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt @@ -0,0 +1,17 @@ +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME +inline class Z(val x: Int) + +var topLevel = Z(42) + +fun box(): String { + val ref = ::topLevel + + if (ref.get().x != 42) throw AssertionError() + + ref.set(Z(1234)) + if (ref.get().x != 1234) throw AssertionError() + + 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 0ae3db8aa93..51d20175b90 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -12029,6 +12029,94 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt"); } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/callableReferences") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReferences extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInCallableReferences() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/callableReferences"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("boundInlineClassExtensionFun.kt") + public void testBoundInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt"); + } + + @TestMetadata("boundInlineClassExtensionVal.kt") + public void testBoundInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt"); + } + + @TestMetadata("boundInlineClassMemberFun.kt") + public void testBoundInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt"); + } + + @TestMetadata("boundInlineClassMemberVal.kt") + public void testBoundInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt"); + } + + @TestMetadata("boundInlineClassPrimaryVal.kt") + public void testBoundInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt"); + } + + @TestMetadata("funWithInlineClassParameters.kt") + public void testFunWithInlineClassParameters() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt"); + } + + @TestMetadata("inlineClassExtensionFun.kt") + public void testInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt"); + } + + @TestMetadata("inlineClassExtensionVal.kt") + public void testInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); + } + + @TestMetadata("inlineClassMemberFun.kt") + public void testInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); + } + + @TestMetadata("inlineClassMemberVal.kt") + public void testInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt"); + } + + @TestMetadata("inlineClassPrimaryConstructor.kt") + public void testInlineClassPrimaryConstructor() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt"); + } + + @TestMetadata("inlineClassPrimaryVal.kt") + public void testInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); + } + + @TestMetadata("inlineClassTypeBoundMemberVar.kt") + public void testInlineClassTypeBoundMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeMemberVar.kt") + public void testInlineClassTypeMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeTopLevelVar.kt") + public void testInlineClassTypeTopLevelVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/contextsAndAccessors") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 2581c147a32..2c38fb480c5 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -12029,6 +12029,94 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt"); } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/callableReferences") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReferences extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInCallableReferences() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/callableReferences"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("boundInlineClassExtensionFun.kt") + public void testBoundInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt"); + } + + @TestMetadata("boundInlineClassExtensionVal.kt") + public void testBoundInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt"); + } + + @TestMetadata("boundInlineClassMemberFun.kt") + public void testBoundInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt"); + } + + @TestMetadata("boundInlineClassMemberVal.kt") + public void testBoundInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt"); + } + + @TestMetadata("boundInlineClassPrimaryVal.kt") + public void testBoundInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt"); + } + + @TestMetadata("funWithInlineClassParameters.kt") + public void testFunWithInlineClassParameters() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt"); + } + + @TestMetadata("inlineClassExtensionFun.kt") + public void testInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt"); + } + + @TestMetadata("inlineClassExtensionVal.kt") + public void testInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); + } + + @TestMetadata("inlineClassMemberFun.kt") + public void testInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); + } + + @TestMetadata("inlineClassMemberVal.kt") + public void testInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt"); + } + + @TestMetadata("inlineClassPrimaryConstructor.kt") + public void testInlineClassPrimaryConstructor() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt"); + } + + @TestMetadata("inlineClassPrimaryVal.kt") + public void testInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); + } + + @TestMetadata("inlineClassTypeBoundMemberVar.kt") + public void testInlineClassTypeBoundMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeMemberVar.kt") + public void testInlineClassTypeMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeTopLevelVar.kt") + public void testInlineClassTypeTopLevelVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/contextsAndAccessors") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index fe3afe86f3b..e6980bbcf49 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -12034,6 +12034,94 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt"); } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/callableReferences") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReferences extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCallableReferences() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/callableReferences"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("boundInlineClassExtensionFun.kt") + public void testBoundInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt"); + } + + @TestMetadata("boundInlineClassExtensionVal.kt") + public void testBoundInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt"); + } + + @TestMetadata("boundInlineClassMemberFun.kt") + public void testBoundInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt"); + } + + @TestMetadata("boundInlineClassMemberVal.kt") + public void testBoundInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt"); + } + + @TestMetadata("boundInlineClassPrimaryVal.kt") + public void testBoundInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt"); + } + + @TestMetadata("funWithInlineClassParameters.kt") + public void testFunWithInlineClassParameters() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt"); + } + + @TestMetadata("inlineClassExtensionFun.kt") + public void testInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt"); + } + + @TestMetadata("inlineClassExtensionVal.kt") + public void testInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); + } + + @TestMetadata("inlineClassMemberFun.kt") + public void testInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); + } + + @TestMetadata("inlineClassMemberVal.kt") + public void testInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt"); + } + + @TestMetadata("inlineClassPrimaryConstructor.kt") + public void testInlineClassPrimaryConstructor() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt"); + } + + @TestMetadata("inlineClassPrimaryVal.kt") + public void testInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); + } + + @TestMetadata("inlineClassTypeBoundMemberVar.kt") + public void testInlineClassTypeBoundMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeMemberVar.kt") + public void testInlineClassTypeMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeTopLevelVar.kt") + public void testInlineClassTypeTopLevelVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/contextsAndAccessors") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) 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 68fff3a18bd..a997e60c037 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 @@ -10549,6 +10549,94 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt"); } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/callableReferences") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReferences extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInCallableReferences() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/callableReferences"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("boundInlineClassExtensionFun.kt") + public void testBoundInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt"); + } + + @TestMetadata("boundInlineClassExtensionVal.kt") + public void testBoundInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt"); + } + + @TestMetadata("boundInlineClassMemberFun.kt") + public void testBoundInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt"); + } + + @TestMetadata("boundInlineClassMemberVal.kt") + public void testBoundInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt"); + } + + @TestMetadata("boundInlineClassPrimaryVal.kt") + public void testBoundInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt"); + } + + @TestMetadata("funWithInlineClassParameters.kt") + public void testFunWithInlineClassParameters() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt"); + } + + @TestMetadata("inlineClassExtensionFun.kt") + public void testInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt"); + } + + @TestMetadata("inlineClassExtensionVal.kt") + public void testInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); + } + + @TestMetadata("inlineClassMemberFun.kt") + public void testInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); + } + + @TestMetadata("inlineClassMemberVal.kt") + public void testInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt"); + } + + @TestMetadata("inlineClassPrimaryConstructor.kt") + public void testInlineClassPrimaryConstructor() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt"); + } + + @TestMetadata("inlineClassPrimaryVal.kt") + public void testInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); + } + + @TestMetadata("inlineClassTypeBoundMemberVar.kt") + public void testInlineClassTypeBoundMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeMemberVar.kt") + public void testInlineClassTypeMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeTopLevelVar.kt") + public void testInlineClassTypeTopLevelVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/contextsAndAccessors") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) 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 a005a243cbd..f27cc0537f5 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 @@ -11594,6 +11594,94 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/useThisInsideInlineClass.kt"); } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/callableReferences") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReferences extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInCallableReferences() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/callableReferences"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("boundInlineClassExtensionFun.kt") + public void testBoundInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionFun.kt"); + } + + @TestMetadata("boundInlineClassExtensionVal.kt") + public void testBoundInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassExtensionVal.kt"); + } + + @TestMetadata("boundInlineClassMemberFun.kt") + public void testBoundInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberFun.kt"); + } + + @TestMetadata("boundInlineClassMemberVal.kt") + public void testBoundInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassMemberVal.kt"); + } + + @TestMetadata("boundInlineClassPrimaryVal.kt") + public void testBoundInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/boundInlineClassPrimaryVal.kt"); + } + + @TestMetadata("funWithInlineClassParameters.kt") + public void testFunWithInlineClassParameters() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/funWithInlineClassParameters.kt"); + } + + @TestMetadata("inlineClassExtensionFun.kt") + public void testInlineClassExtensionFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionFun.kt"); + } + + @TestMetadata("inlineClassExtensionVal.kt") + public void testInlineClassExtensionVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt"); + } + + @TestMetadata("inlineClassMemberFun.kt") + public void testInlineClassMemberFun() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt"); + } + + @TestMetadata("inlineClassMemberVal.kt") + public void testInlineClassMemberVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberVal.kt"); + } + + @TestMetadata("inlineClassPrimaryConstructor.kt") + public void testInlineClassPrimaryConstructor() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryConstructor.kt"); + } + + @TestMetadata("inlineClassPrimaryVal.kt") + public void testInlineClassPrimaryVal() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt"); + } + + @TestMetadata("inlineClassTypeBoundMemberVar.kt") + public void testInlineClassTypeBoundMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeMemberVar.kt") + public void testInlineClassTypeMemberVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeMemberVar.kt"); + } + + @TestMetadata("inlineClassTypeTopLevelVar.kt") + public void testInlineClassTypeTopLevelVar() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeTopLevelVar.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/contextsAndAccessors") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)