diff --git a/compiler/testData/codegen/box/callableReference/kt16752.kt b/compiler/testData/codegen/box/callableReference/kt16752.kt new file mode 100644 index 00000000000..b1b491aeed3 --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/kt16752.kt @@ -0,0 +1,13 @@ +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM + +class Incrementer : (Int) -> Int by Int::inc + +fun box(): String { + val incr = Incrementer() + + val test = incr(5) + if (test != 6) throw Exception("incr(5): $test") + + return "OK" +} \ No newline at end of file diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 372687e0cb8..38bac3187c7 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -1260,6 +1260,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("kt16752.kt") + public void testKt16752() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/kt16752.kt"); + } + @TestMetadata("kt37604.kt") public void testKt37604() throws Exception { runTest("compiler/testData/codegen/box/callableReference/kt37604.kt");