when (node.elementType) {
CLASS, FUN, PRIMARY_CONSTRUCTOR, SECONDARY_CONSTRUCTOR -> checkAnnotation(node)
}
is being fixed to
when (node.elementType) {
CLASS, FUN, PRIMARY_CONSTRUCTOR, SECONDARY_CONSTRUCTOR -> checkAnnotation(node)
else -> {
// this is a generated else block
}}
even though there should be a newline before the lase }
This is actually not NewlinesRule but rather BlockStructureBraces rule. It's placed higher in rule set provider that WhenMustHaveElse. The code in the example is correctly fixed in diktat on the second run.
The code
is being fixed to
even though there should be a newline before the lase
}