Lambda to anonymous: report only from left brace to arrow

This commit is contained in:
Mikhail Glukhikh
2018-05-15 15:26:02 +03:00
parent f4acaae364
commit 6a1ddd6c70
10 changed files with 25 additions and 11 deletions
@@ -2,5 +2,5 @@ class Foo
fun bar(f: Foo.() -> Unit) {}
fun main(args: Array<String>) {
bar {}<caret>
bar {<caret>}
}
@@ -2,5 +2,5 @@ class Foo
fun baz(f: Foo.(i: Int, j: Int) -> Int) {}
fun main(args: Array<String>) {
baz { i, j -> i + j }<caret>
baz { i, <caret>j -> i + j }
}
@@ -1,10 +1,10 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo {
foo {<caret>
if (it == 1) {
return@foo "1"
}
"$it"
<caret>}
}
}
@@ -1,7 +1,7 @@
fun foo(f: (Int) -> String) {}
fun test() {
foo {
foo {<caret>
if (it == 1) {
return@foo "1"
} else if (it == 2) {
@@ -9,5 +9,5 @@ fun test() {
} else {
return@foo "$it"
}
}<caret>
}
}
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun foo(f: () -> String) {}
fun test() {
foo { -> "" <caret>}
}
@@ -1,5 +1,5 @@
fun foo(f: () -> String) {}
fun test() {
foo <caret>{ "" }
foo { <caret>-> "" }
}
@@ -3,8 +3,8 @@ fun unit(f: (Int) -> Unit) {}
fun foo(i: Int) {}
fun test() {
unit {
unit {<caret>
foo(it)
foo(it)
}<caret>
}
}