Closed
Description
Minimized code
A sample like this compiles fine:
object A:
def fn: Unit =
if true then
println(1)
else
println(2)
but this one does not:
object A:
def fn: Unit =
if true then
println(1)
println(1)
else
println(2)
This is most likely due to one being a single statement and the other one is treated as a block, but this is a bit of an incoherent behavior and could lead to hard to spot errors.
Expectation
Then should require a proper increasing indentation and both examples should fail.