HairyFotr / linter

Static Analysis Compiler Plugin for Scala
Apache License 2.0
268 stars 34 forks source link

Returning null instead of Option #2

Closed anze3db closed 11 years ago

anze3db commented 11 years ago

This should cause a warning:

def test : Option[Type] = null

The user probably meant to return None.

HairyFotr commented 11 years ago

There are a few warnings I've commented out, that are more strict: warn on all nulls, on all Option.get, ...

But I like this one, because it's almost surely a bug. Will add it today, thanks for reporting.