streetsofboston
08/28/2025, 7:55 PMif (width > 0) {
set(WIDTH, width.toString())
} else if (height > 0) {
set(HEIGHT, height.toString())
}
append(DPR, "${screen.densityScale}")
and then ask to replace the if with a when statement ("Replace 'if' with 'when'" action), then this is the result:
when {
width > 0 -> {
set(WIDTH, width.toString())
}
height > 0 -> {
set(HEIGHT, height.toString())
}
else -> append(DPR, "${screen.densityScale}")
}
the append
call should NOT appear in the else
branch. Instead, shouldn't it stay outside the when-statement?
Is this a bug?Colton Idle
08/30/2025, 2:42 PM