SimplifyCallChainFix: Keep comments in place #KT-22552 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
9bc874f647
commit
1d2e18e263
+12
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val x = listOf(1, 2, 3).<caret>map(
|
||||
// comment1
|
||||
Int::toString
|
||||
).joinToString(
|
||||
// comment2
|
||||
prefix = "= ",
|
||||
// comment3
|
||||
separator = " + "
|
||||
// comment4
|
||||
)
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val x = listOf(1, 2, 3).joinToString(
|
||||
// comment2
|
||||
prefix = "= ",
|
||||
// comment3
|
||||
separator = " + "
|
||||
// comment4
|
||||
,
|
||||
// comment1
|
||||
transform = Int::toString
|
||||
)
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val sb = StringBuilder()
|
||||
val x = listOf(1, 2, 3).<caret>map { "$it*$it" }.joinTo(
|
||||
// comment1
|
||||
buffer = sb,
|
||||
// comment2
|
||||
prefix = "= ",
|
||||
// comment3
|
||||
separator = " + "
|
||||
// comment4
|
||||
)
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val sb = StringBuilder()
|
||||
val x = listOf(1, 2, 3).joinTo(
|
||||
// comment1
|
||||
buffer = sb,
|
||||
// comment2
|
||||
prefix = "= ",
|
||||
// comment3
|
||||
separator = " + "
|
||||
// comment4
|
||||
) { "$it*$it" }
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test() {
|
||||
<caret>listOf(
|
||||
true, // comment1
|
||||
null // comment2
|
||||
).filterNotNull().first()
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test() {
|
||||
<caret>listOfNotNull(
|
||||
true, // comment1
|
||||
null // comment2
|
||||
).first()
|
||||
}
|
||||
Reference in New Issue
Block a user