You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val x =5val output =if (x >0)
// Greater than zero"Positive"else// Not greater than zero"Not positive"
Expected Behavior
ktlint --experimental --format should yield:
val x =5val output =if (x >0) {
// Greater than zero"Positive"
} else {
// Not greater than zero"Not positive"
}
Observed Behavior
Generates code that doesn't compile:
val x =5val output =if (x >0)
// Greater than zero {"Positive"
} else// Not greater than zero {"Not positive"
}
Your Environment
Version of ktlint used: 0.39.0
The text was updated successfully, but these errors were encountered:
ming-zhang
changed the title
Opening bracket for if-else is added to a commented line
Opening bracket for if-else is added to a commented line (output won't compile)
Oct 15, 2020
Source Code
Expected Behavior
ktlint --experimental --format
should yield:Observed Behavior
Generates code that doesn't compile:
Your Environment
The text was updated successfully, but these errors were encountered: