kenkyee
09/10/2023, 7:43 PMsealed class T(val name: String) {
sealed class C(
name: String,
val something: String,
) : T
object Black : C(
* name = "black",
* something = "else",
) @
It wants the lines marked with "*" to be indented at 16 spaces instead of 12.
We're using the default indentation which should be 4.
==========
Multiline expresssions are also a bit weird... it wants
fontFamily = when (fontFamily) {
to be formatted like this:
fontFamily =
when (fontFamily) {
I would have expected it to at least indent the when in by 4 spaces...
Edit: looks like first might be bug. Second is ok after I tried creating repro snippets. Snippets in 🧵kenkyee
09/10/2023, 8:33 PMsealed class T(val name: String) {
sealed class C(
name: String,
val something: String,
) : T(name) {
object Black : C(
name = "black",
something = "else",
)
}
}
kenkyee
09/10/2023, 8:34 PMdata class T(
val fontSize: Int,
val fontFamily: String,
)
class Test(val fontFamily: String) {
val familyType: T
get() =
T(
fontSize = 1,
fontFamily =
when (fontFamily) {
"1" ->
"yes"
else ->
"no"
},
)
}
The original code had "get() = T(" on the same line and when that was the case, it wanted the "when" at the same indentation as "fontFamily". But this violates the multiline expression rule, so "T(" should be on a separate line.kenkyee
09/10/2023, 8:35 PM