I am curious:
scala> Some(null) == None res10: Boolean = false
Why isn't Some(null) transformed to None?
Some(null)
None
You should use Option(null) to reach the desired effect and return None.
Option(null)
Some(null) just creates a new Option with a defined value (hence Some) which is actually null, and there are few valid reasons to ever create one like this in real code.
Option
Some
null
548k questions
547k answers
4 comments
86.3k users