Format functions with function literal arguments (KT-2934)
#KT-2934 Fixed
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import java.util.ArrayList
|
||||
|
||||
fun test() {
|
||||
val abc = ArrayList<Int>()
|
||||
.map {
|
||||
it * 2
|
||||
}
|
||||
.filter {
|
||||
it > 4
|
||||
}
|
||||
}
|
||||
|
||||
fun test1() {
|
||||
val abc = ArrayList<Int>()
|
||||
.map({
|
||||
it * 2
|
||||
})
|
||||
.filter({
|
||||
it > 4
|
||||
})
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
val abc = ArrayList<Int>()
|
||||
.map {
|
||||
it * 2
|
||||
}
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
val abc = ArrayList<Int>().map {
|
||||
it * 2
|
||||
}
|
||||
}
|
||||
|
||||
fun testWithComments() {
|
||||
val abc = ArrayList<Int>()
|
||||
// .map {
|
||||
// it * 2
|
||||
// }
|
||||
.filter {
|
||||
it > 4
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import java.util.ArrayList
|
||||
|
||||
fun test() {
|
||||
val abc = ArrayList<Int>()
|
||||
.map {
|
||||
it * 2
|
||||
}
|
||||
.filter {
|
||||
it > 4
|
||||
}
|
||||
}
|
||||
|
||||
fun test1() {
|
||||
val abc = ArrayList<Int>()
|
||||
.map({
|
||||
it * 2
|
||||
})
|
||||
.filter({
|
||||
it > 4
|
||||
})
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
val abc = ArrayList<Int>()
|
||||
.map {
|
||||
it * 2
|
||||
}
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
val abc = ArrayList<Int>().map {
|
||||
it * 2
|
||||
}
|
||||
}
|
||||
|
||||
fun testWithComments() {
|
||||
val abc = ArrayList<Int>()
|
||||
// .map {
|
||||
// it * 2
|
||||
// }
|
||||
.filter {
|
||||
it > 4
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
trait Test {
|
||||
fun foo(): Test
|
||||
}
|
||||
|
||||
fun test(t: Test) {
|
||||
t.foo()
|
||||
|
||||
t.
|
||||
foo()
|
||||
|
||||
t.
|
||||
|
||||
|
||||
foo()
|
||||
|
||||
t
|
||||
|
||||
|
||||
.foo()
|
||||
|
||||
|
||||
t.foo().foo()
|
||||
|
||||
|
||||
t?.foo()
|
||||
|
||||
t?.
|
||||
foo()
|
||||
|
||||
t?.
|
||||
|
||||
|
||||
foo()
|
||||
|
||||
t
|
||||
|
||||
|
||||
?.foo()
|
||||
|
||||
t?.foo()?.foo()
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
trait Test {
|
||||
fun foo(): Test
|
||||
}
|
||||
|
||||
fun test(t: Test) {
|
||||
t . foo()
|
||||
|
||||
t.
|
||||
foo()
|
||||
|
||||
t.
|
||||
|
||||
|
||||
foo()
|
||||
|
||||
t
|
||||
|
||||
|
||||
|
||||
.foo()
|
||||
|
||||
|
||||
t.foo() . foo()
|
||||
|
||||
|
||||
t ?. foo()
|
||||
|
||||
t?.
|
||||
foo()
|
||||
|
||||
t?.
|
||||
|
||||
|
||||
foo()
|
||||
|
||||
t
|
||||
|
||||
|
||||
|
||||
?.foo()
|
||||
|
||||
t?.foo() ?. foo()
|
||||
}
|
||||
Reference in New Issue
Block a user