diff --git a/compiler/testData/codegen/java8/box/jvm8/inlineFromAnotherFile.kt b/compiler/testData/codegen/java8/box/jvm8/inlineFromAnotherFile.kt new file mode 100644 index 00000000000..b3363754a9f --- /dev/null +++ b/compiler/testData/codegen/java8/box/jvm8/inlineFromAnotherFile.kt @@ -0,0 +1,19 @@ +// JVM_TARGET: 1.8 +//WITH_RUNTIME + +// FILE: 1.kt +package test + +public inline fun Iterable.fold2(initial: R, operation: (R, T) -> R): R { + var accumulator = initial + for (element in this) accumulator = operation(accumulator, element) + return accumulator +} + +// FILE: 2.kt +import test.* + +fun box(): String { + val list = listOf("O", "K") + return list.fold2("") {a, b -> a +b} +} \ No newline at end of file diff --git a/compiler/testData/codegen/java8/box/jvm8/inlineFromStdlib.kt b/compiler/testData/codegen/java8/box/jvm8/inlineFromStdlib.kt new file mode 100644 index 00000000000..289c4d91aa9 --- /dev/null +++ b/compiler/testData/codegen/java8/box/jvm8/inlineFromStdlib.kt @@ -0,0 +1,8 @@ +// JVM_TARGET: 1.8 +//WITH_RUNTIME + +fun box(): String { + val list = listOf("O", "K") + return list.fold("") {a, b -> a +b} +} + diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/codegen/BlackBoxWithJava8CodegenTestGenerated.java b/compiler/tests-java8/tests/org/jetbrains/kotlin/codegen/BlackBoxWithJava8CodegenTestGenerated.java index 56e88529734..f9095baf946 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/codegen/BlackBoxWithJava8CodegenTestGenerated.java +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/codegen/BlackBoxWithJava8CodegenTestGenerated.java @@ -203,6 +203,18 @@ public class BlackBoxWithJava8CodegenTestGenerated extends AbstractBlackBoxCodeg doTest(fileName); } + @TestMetadata("inlineFromAnotherFile.kt") + public void testInlineFromAnotherFile() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/jvm8/inlineFromAnotherFile.kt"); + doTest(fileName); + } + + @TestMetadata("inlineFromStdlib.kt") + public void testInlineFromStdlib() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/jvm8/inlineFromStdlib.kt"); + doTest(fileName); + } + @TestMetadata("kt11969.kt") public void testKt11969() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/jvm8/kt11969.kt");