Extract Function: Support multiple output values
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(c : Collection<String>){
|
||||
c.filter<selection>{it; false}</selection>
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(c : Collection<String>){
|
||||
val function = { it; false }
|
||||
val function: (String) -> Boolean = { it; false }
|
||||
c.filter(function)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun main(args: Array<String>) {
|
||||
with(A()) {
|
||||
println(<selection>prop</selection>)
|
||||
@@ -7,6 +8,4 @@ fun main(args: Array<String>) {
|
||||
|
||||
class A {
|
||||
val prop = 1
|
||||
}
|
||||
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun main(args: Array<String>) {
|
||||
with(A()) {
|
||||
val i = prop
|
||||
@@ -8,6 +9,4 @@ fun main(args: Array<String>) {
|
||||
|
||||
class A {
|
||||
val prop = 1
|
||||
}
|
||||
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
}
|
||||
Reference in New Issue
Block a user