The following is legal in scalac and creates a method with return type Unit:
trait Message {
def first(x: Int)
}
In Dotty, it's illegal, I agree with that, but the error message should tell you that you're missing a return type, instead you get:
confusing.scala:3: error: '=' expected but '}' found.
}
^
one error found
which is hard to diagnose.