KT-2242 formatting problems: function literal passed outside the parentheses - option for spaces in single line function literal

#KT-2242 Fixed
This commit is contained in:
Nikolay Krasko
2012-08-21 16:10:45 +04:00
parent e7287ba8f4
commit 9c91acac74
10 changed files with 52 additions and 9 deletions
@@ -1,4 +1,6 @@
fun test(some: (Int) -> Int) {
}
fun foo() = test() {a -> if (true) { a } else { 1 }}
fun foo() = test() {a -> if (true) { a } else { 1 }}
// SET_TRUE: INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD
@@ -7,4 +7,6 @@ fun foo() = test() { a ->
} else {
1
}
}
}
// SET_TRUE: INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD
@@ -0,0 +1,12 @@
fun test(some: (Int) -> Int) {
}
fun foo() = test() {a ->
if (true) {
a
} else {
1
}
}
// SET_TRUE: INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD
@@ -1,4 +1,6 @@
fun test(some: (Int) -> Int) {
}
fun foo() = test() { it }
fun foo() = test() { it }
// SET_TRUE: INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD
@@ -1,4 +1,6 @@
fun test(some: (Int) -> Int) {
}
fun foo() = test() { it }
fun foo() = test() { it }
// SET_TRUE: INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD
@@ -0,0 +1,6 @@
fun test(some: (Int) -> Int) {
}
fun foo() = test() {it}
// SET_TRUE: INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD