3 ms·
Yes, there is. That's one of the great things about Scala's typesystem. It makes those things easy to even write yourself, but there is already something builti
by valenterry 4y ago
Yes, there is. That's one of the great things about Scala's typesystem. It makes those things easy to even write yourself, but there is already something builtin:
https://scalacenter.github.io/scalafix/docs/rules/ExplicitResultTypes.html https://scalacenter.github.io/scalafix/docs/rules/ExplicitRe...
However, from my experience it's actually better to not annotate most things. I annotate methods are that used very often or are "borders" of my API or interface. Otherwise it is usually not needed because it rarely makes the code more clear and IDEs like IntelliJ actually show you the types inline automatically, so you can always see the return type easily.