Closed
Description
Compiler version
3.0.0-RC2-bin-20210317-758782a-NIGHTLY
Minimized code
def bar2: Int = {
println(1)
println(2)
return
var x = 1
var y = 1
x + y
}
bar2
Output
return
^^^^^^
Found: Unit
Required: Int
Expectation
According to:
http://dotty.epfl.ch/docs/reference/other-new-features/indentation.html#optional-braces
... an indentation region can start ... after one of the following tokens:
... return ...
So the code should compile, or the reference should be adjusted.