From d71ff1818da80a552e314af2482b56658a42505b Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Tue, 8 May 2018 14:56:46 +0300 Subject: [PATCH] Add test --- .../js/test/semantics/BoxJsTestGenerated.java | 5 +++++ .../js/test/semantics/IrBoxJsTestGenerated.java | 5 +++++ .../function/constructorsWithArgsSimple.kt | 16 ++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 js/js.translator/testData/box/callableReference/function/constructorsWithArgsSimple.kt diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java index ec0e195c496..0a19f29e42f 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java @@ -141,6 +141,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest { runTest("js/js.translator/testData/box/callableReference/function/constructorsWithArgs.kt"); } + @TestMetadata("constructorsWithArgsSimple.kt") + public void testConstructorsWithArgsSimple() throws Exception { + runTest("js/js.translator/testData/box/callableReference/function/constructorsWithArgsSimple.kt"); + } + @TestMetadata("extension.kt") public void testExtension() throws Exception { runTest("js/js.translator/testData/box/callableReference/function/extension.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java index 1a14aaa7d7d..b560106e321 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java @@ -141,6 +141,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest { runTest("js/js.translator/testData/box/callableReference/function/constructorsWithArgs.kt"); } + @TestMetadata("constructorsWithArgsSimple.kt") + public void testConstructorsWithArgsSimple() throws Exception { + runTest("js/js.translator/testData/box/callableReference/function/constructorsWithArgsSimple.kt"); + } + @TestMetadata("extension.kt") public void testExtension() throws Exception { runTest("js/js.translator/testData/box/callableReference/function/extension.kt"); diff --git a/js/js.translator/testData/box/callableReference/function/constructorsWithArgsSimple.kt b/js/js.translator/testData/box/callableReference/function/constructorsWithArgsSimple.kt new file mode 100644 index 00000000000..de10dbacc0e --- /dev/null +++ b/js/js.translator/testData/box/callableReference/function/constructorsWithArgsSimple.kt @@ -0,0 +1,16 @@ +// EXPECTED_REACHABLE_NODES: 1112 +package foo + +class A(val x: Int) { + var s = "sA:init:$x" +} + +class B(val arg1: String, val arg2: String) { + var msg = arg1 + arg2 +} + +fun box(): String { + val ref = ::A + val result = ref(1).s + (::B)("23", "45").msg + return (if (result == "sA:init:12345") "OK" else result) +}