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
@@ -0,0 +1,12 @@
package n
//+JDK
import java.util.*
fun expected<T>(t: T, <!UNUSED_PARAMETER!>f<!>: () -> T) : T = t
fun test(arrayList: ArrayList<Int>, list: List<Int>) {
val <!UNUSED_VARIABLE!>t<!> = expected(arrayList, @l {return@l list.reverse() })
}
fun <T> List<T>.reverse() : List<T> = this
@@ -0,0 +1,7 @@
package
package n {
internal fun </*0*/ T> expected(/*0*/ t: T, /*1*/ f: () -> T): T
internal fun test(/*0*/ arrayList: java.util.ArrayList<kotlin.Int>, /*1*/ list: kotlin.List<kotlin.Int>): kotlin.Unit
internal fun </*0*/ T> kotlin.List<T>.reverse(): kotlin.List<T>
}