Support local return in lambda without explicit return type

This commit is contained in:
Stanislav Erokhin
2015-02-17 15:20:12 +03:00
parent def81d30dc
commit 57fd5cc84c
41 changed files with 340 additions and 40 deletions
@@ -6,7 +6,7 @@ public inline fun <reified T> Array(n: Int, block: (Int) -> T): Array<T> = null!
fun test() {
val ints = Array<Int?>(2, { null })
ints.forEach @lit {
if (it == null) <!RETURN_NOT_ALLOWED_EXPLICIT_RETURN_TYPE_REQUIRED!>return @lit<!>
if (it == null) return @lit
use(<!DEBUG_INFO_SMARTCAST!>it<!> + 5)
}
}