forked from scalastyle/scalastyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Scalastyle proposed rules (Types)
Matthew Farwell edited this page Nov 16, 2011
·
3 revisions
This page contains proposed rules for Scalastyle, for the category Types
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
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.