2 ms·
That is often considered undesirable because it makes code less clear and compilation errors inscrutable. For instance the rust developers consciously decided
by masklinn 4y ago
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.
- estebank 4y agoEaster egg: you can use -> _ to ask the compiler what type it thinks the return type should be, given your body. Because it is only used for diagnostics it isn't fully featured and there are things it doesn't cope well with, but it is there and works most of the time.
- still_grokking 4y agoStatic type inference is "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.