No "unreachable code" errors when an illegal return expression is the last in a lambda

This commit is contained in:
Andrey Breslav
2013-08-16 18:09:01 +04:00
parent 34df845778
commit 9f90fd0938
3 changed files with 43 additions and 2 deletions
@@ -0,0 +1,18 @@
fun test() {
run {<!RETURN_NOT_ALLOWED!>return<!>}
run {}
}
fun test2() {
run {<!RETURN_NOT_ALLOWED!>return@test2<!>}
run {}
}
fun test3() {
fun test4() {
run {<!RETURN_NOT_ALLOWED!>return@test3<!>}
run {}
}
}
fun run<T>(f: () -> T): T { return f() }