Generate return type signature in Scala using Intellij Idea
1 answer
If you are using the name of the method, you can hit ALT+ ENTERto get Intention actions, in which the first is usuallyAdd type annotation to function definition
Illustration:
In this case, it will add Int
to the return type exampleFunction
.
May I add this, also works for declarations val
/ var
, essentially whenever there is a type that is inferred.
+10
source to share