Support local return in lambda without explicit return type
This commit is contained in:
@@ -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>
|
||||
}
|
||||
Reference in New Issue
Block a user