You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Matthew Farwell edited this page Nov 16, 2011
·
3 revisions
This page contains proposed rules for Scalastyle, for the category Types
Types
publicMethodsDeclaredTypes
Checks any publicly accessible methods have the type explicitly declared.
This passes:
def method(): Int = 1
This fails
def method() = 1
Rationale: This helps with understanding a method
Type Annotation
Checks that types are annotated with the colon in the correct place
This passes:
def method(): Int = 1
This fails
def method() : Int = 1
Rationale: This is standard behaviour in the scala library, and avoids confusion in certain circumstances.