Get rid of obsolete syntax in quickfixes changing lambda's signature

- Do not wrap parameters with '()'
- Do not set return type for them
- Fix existing testData
This commit is contained in:
Denis Zharkov
2015-09-24 17:58:23 +03:00
parent 31d2aa23f5
commit 1d90b2e1fe
41 changed files with 61 additions and 58 deletions
@@ -1,3 +1,3 @@
fun foo() {
val v1 = {(z: Int, y1: String, x: Any): Int -> println(z); println(y1) }
val v1 = { z: Int, y1: String, x: Any -> println(z); println(y1) }
}
@@ -1,3 +1,3 @@
fun foo() {
val v1 = {(<caret>z: Int, y: String) -> println(z); println(y) }
val v1 = {<caret>z: Int, y: String -> println(z); println(y) }
}
@@ -1,5 +1,5 @@
fun test() {
SamTest.test(Foo<String, Int> { (s, n) -> "" })
SamTest.test(Foo { (s: MutableList<X<Int>>, n: X<MutableSet<String>>) -> "" })
SamTest.test(Foo { (s: MutableList<X<Int>>, n: X<MutableSet<String>>): X<MutableList<String>>? -> "" })
SamTest.test(Foo<String, Int> { s, n -> "" })
SamTest.test(Foo { s: MutableList<X<Int>>, n: X<MutableSet<String>> -> "" })
SamTest.test(Foo { s: MutableList<X<Int>>, n: X<MutableSet<String>> -> "" })
}
@@ -1,5 +1,5 @@
fun test() {
SamTest.test(Foo<String, Int> { (s, n) -> "" })
SamTest.test(Foo { (s: String, n: Int) -> "" })
SamTest.test(Foo { (s: String, n: Int): String -> "" })
SamTest.test(Foo<String, Int> { s, n -> "" })
SamTest.test(Foo { s: String, n: Int -> "" })
SamTest.test(Foo { s: String, n: Int -> "" })
}
@@ -1,5 +1,5 @@
fun test() {
JTest.samTest(SAM { " " })
JTest.samTest(SAM { () -> " " })
JTest.samTest(SAM { -> " " })
JTest.samTest(SAM { -> " " })
}
@@ -1,3 +1,3 @@
fun test() {
JTest.samTest(SAM {(s, n, o) -> s + " " + n })
JTest.samTest(SAM { s, n, o -> s + " " + n })
}
@@ -1,3 +1,3 @@
fun test() {
JTest.samTest(SAM { (s, n) -> s + " " + n })
JTest.samTest(SAM { s, n -> s + " " + n })
}
@@ -1,5 +1,5 @@
fun test() {
JTest.samTest(SAM {(n, s) -> s + " " })
JTest.samTest(SAM {(n, s) -> s + " " })
JTest.samTest(SAM {(n, it) -> it + " " })
JTest.samTest(SAM { n, s -> s + " " })
JTest.samTest(SAM { n, s -> s + " " })
JTest.samTest(SAM { n, it -> it + " " })
}
@@ -1,5 +1,5 @@
fun test() {
JTest.samTest(SAM { s -> s + " " })
JTest.samTest(SAM { (s) -> s + " " })
JTest.samTest(SAM { s -> s + " " })
JTest.samTest(SAM { it + " " })
}
@@ -1,4 +1,4 @@
fun test() {
JTest.samTest(SAM { (s, n) -> s + " " })
JTest.samTest(SAM { (s, n): Any? -> s + " " })
JTest.samTest(SAM { s, n -> s + " " })
JTest.samTest(SAM { s, n -> s + " " })
}
@@ -1,4 +1,4 @@
fun test() {
JTest.samTest(SAM { (s, n) -> s + " " })
JTest.samTest(SAM { (s, n): String -> s + " " })
JTest.samTest(SAM { s, n -> s + " " })
JTest.samTest(SAM { s, n -> s + " " })
}
@@ -1,4 +1,4 @@
fun test() {
JTest.samTest(SAM { (s, n) -> s + " " })
JTest.samTest(SAM { (s: Any, n: Int) -> x + " " })
JTest.samTest(SAM { s, n -> s + " " })
JTest.samTest(SAM { s: Any, n: Int -> x + " " })
}
@@ -1,4 +1,4 @@
fun test() {
JTest.samTest(SAM { (s, n) -> s + " " })
JTest.samTest(SAM { (s: String, n: Int) -> x + " " })
JTest.samTest(SAM { s, n -> s + " " })
JTest.samTest(SAM { s: String, n: Int -> x + " " })
}
@@ -1,4 +1,4 @@
fun test() {
JTest.samTest(SAM { (s, n) -> s + " " })
JTest.samTest(SAM { (x, y) -> x + " " })
JTest.samTest(SAM { s, n -> s + " " })
JTest.samTest(SAM { x, y -> x + " " })
}
@@ -1,5 +1,4 @@
fun test() {
JTest.samTest(SAM { s + " " })
JTest.samTest(SAM { s + " " })
JTest.samTest(SAM { it + " " })
}
@@ -1,5 +1,4 @@
fun test() {
JTest.samTest(SAM { s -> s + " " })
JTest.samTest(SAM { (s) -> s + " " })
JTest.samTest(SAM { it + " " })
}