Skip to content

Instantly share code, notes, and snippets.

@avibryant
Created September 15, 2013 23:13
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avibryant/6575113 to your computer and use it in GitHub Desktop.
Save avibryant/6575113 to your computer and use it in GitHub Desktop.
scala> val x = null.asInstanceOf[Int]
x: Int = 0
scala> Option(x)
res1: Option[Int] = Some(0)
scala> Option(null.asInstanceOf[Int])
res2: Option[Int] = None
@demobox
Copy link

demobox commented Oct 13, 2013

See SI-6710 and SI-6898 and the resulting puzzler "Cast Away" ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment