Formatter: shouldn't format property chains

#KT-36387 Fixed
#KT-36466 Fixed
This commit is contained in:
Dmitry Gridin
2020-02-13 17:29:40 +07:00
parent 522eeae062
commit feaa53c4f2
16 changed files with 887 additions and 331 deletions
+28
View File
@@ -0,0 +1,28 @@
fun foo() {
listOf(42).map { it }
bar(A().b.toString())
"hello".length
}
fun bar(x: Int) {
}
class A {
val b: B = B()
}
class B {
val c: Int = 42
}
fun usage() {
data class A(val i: Int) {
fun doSmth(): A = this
}
val a = A(10)
a.doSmth().i
}
// SET_INT: METHOD_CALL_CHAIN_WRAP = 2
// SET_TRUE: WRAP_FIRST_METHOD_IN_CALL_CHAIN