Test for obsolete KT-5199: IllegalArgumentException with non local return in lambda
#KT-5199 Obsolete
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import test.*
|
||||
|
||||
fun test1(nonLocal: String): String {
|
||||
val localResult = doCall<String> {
|
||||
return nonLocal
|
||||
}
|
||||
|
||||
return "NON_LOCAL_FAILED"
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
return test1("OK")
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
public inline fun <R> doCall(block: ()-> R) : R {
|
||||
return block()
|
||||
}
|
||||
+6
@@ -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");
|
||||
|
||||
+6
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user