Have we considered that compiler should give a warning in these scenarios?
var ctx:Context = null
case class Employee(val age:Int, val reports:List[Employee] = null)
def readFile(path:String):String = {
if(!File.exists(path)) {
return null
}
}
Basically whenever we are setting or returning null
. The only risk I see is that some projects might have setting to fail if warning present, but am sure it would be helpful to them.