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()
|
||||
}
|
||||
Reference in New Issue
Block a user