Skip to content

Instantly share code, notes, and snippets.

@oxbowlakes
Created April 6, 2016 11:59
Show Gist options
  • Save oxbowlakes/e68014ecd2d952be3a4d36221c6efb78 to your computer and use it in GitHub Desktop.
Save oxbowlakes/e68014ecd2d952be3a4d36221c6efb78 to your computer and use it in GitHub Desktop.
object Unchecked extends App {
class Foo[A] {
def doIt(o: Any): Option[A] = Some(o.asInstanceOf[A])
}
println(new Foo[String].doIt(3))
}
/* compile it */
//scalac Unchecked.scala
/* run it */
//scala Unchecked
//Some(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment