Test for obsolete KT-5199: IllegalArgumentException with non local return in lambda

#KT-5199 Obsolete
This commit is contained in:
Michael Bogdanov
2015-05-20 12:52:30 +03:00
parent 4abaa54d0e
commit a671d684c9
4 changed files with 31 additions and 0 deletions
@@ -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()
}