Earlier quoted context omitted.
Also on a function? var getDate() { return „no date“; }
That is often considered undesirable because it makes code less clear and compilation errors inscrutable. For instance the rust developers consciously decided to remove that from the language, named functions must be fully typed.
def getDate = "no date"
That defines a method `getDate` with the type `() => String` in Scala.The type is statically know, of course.
But it's recommended to use explicit return types for public methods. This helps preventing breaking public API by refactoring the implementation of a method.