documentation/snapshot/docs/rules/experimental.md
!!! important
Up and until Ktlint version 0.47, experimental were located in a separate experimental rule set. As of Ktlint version 0.48, each rule set can optionally define experimental rules.
All experimental rules described below are part of the standard rule set of Ktlint. To enable all experimental rules (from all rule sets), set editorconfig property below:
[*.{kt,kts}]
ktlint_experimental=enabled
Also see enable/disable specific rules.
In case a call expression does not fit on the line, the lambda expression, and/or the value argument list after a reference expression are wrapped.
=== ":material-heart: Ktlint"
```kotlin
// Assume that the last allowed
// character is at the X character
// on the right X
val foo1 = bar() {
"some message"
}
val foo2 = bar(
"foobarrrrrrrrrrrr"
) { "some message" }
val foo3 = bar(
"foobarrrrrrrrrrrr"
) {
"some longgggggggggg message"
}
```
=== ":material-heart-off-outline: Disallowed"
```kotlin
// Assume that the last allowed
// character is at the X character
// on the right X
val foo1 = bar() { "some message" }
val foo2 = bar("foobarrrrrrrrrrrr") { "some message" }
val foo3 = bar("foobarrrrrrrrrrrr") { "some longgggggggggg message" }
```
Rule id: standard:call-expression-wrapping
Suppress or disable rule (1) { .annotate }
@Suppress("ktlint:call-expression-wrapping")
.editorconfig
ktlint_standard_call-expression-wrapping = enabled
.editorconfig
ktlint_standard_call-expression-wrapping = disabled
Wraps each operand in a multiline expression to a separate line.
=== ":material-heart: Ktlint"
```kotlin
val foo1 = bar || baz
val foo2 =
bar1 ||
bar2 ||
baz1 ||
(baz2 && baz3)
val foo3 = bar + baz
val foo4 =
bar1 -
bar2 -
baz1 -
(baz2 * baz3)
```
=== ":material-heart-off-outline: Disallowed"
```kotlin
val foo =
multiLineOperand(
"bar"
) || baz
if (bar1 || bar2 ||
baz1 || (baz2 && baz3)
) {
// do something
}
```
Rule id: standard:expression-operand-wrapping
Suppress or disable rule (1) { .annotate }
@Suppress("ktlint:expression-operand-wrapping")
.editorconfig
ktlint_standard_expression-operand-wrapping = enabled
.editorconfig
ktlint_standard_expression-operand-wrapping = disabled