diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/kt5199.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/kt5199.1.kt new file mode 100644 index 00000000000..4b77d0eecd2 --- /dev/null +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/kt5199.1.kt @@ -0,0 +1,14 @@ +import test.* + +fun test1(nonLocal: String): String { + val localResult = doCall { + return nonLocal + } + + return "NON_LOCAL_FAILED" +} + + +fun box(): String { + return test1("OK") +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/kt5199.2.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/kt5199.2.kt new file mode 100644 index 00000000000..12d90f9709d --- /dev/null +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/kt5199.2.kt @@ -0,0 +1,5 @@ +package test + +public inline fun doCall(block: ()-> R) : R { + return block() +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java index 1665a29366c..31f9c7def62 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java @@ -448,6 +448,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo doTestMultiFileWithInlineCheck(fileName); } + @TestMetadata("kt5199.1.kt") + public void testKt5199() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/nonLocalReturns/kt5199.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + @TestMetadata("nestedNonLocals.1.kt") public void testNestedNonLocals() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/nonLocalReturns/nestedNonLocals.1.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java index bfdffa36208..67278f2cf5f 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -448,6 +448,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi doBoxTestWithInlineCheck(fileName); } + @TestMetadata("kt5199.1.kt") + public void testKt5199() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/nonLocalReturns/kt5199.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + @TestMetadata("nestedNonLocals.1.kt") public void testNestedNonLocals() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/nonLocalReturns/nestedNonLocals.1.kt");