Created
March 31, 2015 15:06
-
-
Save alexarchambault/40b19b406654063ce224 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def cast[T](v: Any): Unit = v.asInstanceOf[T] | |
| def cast1[T](v: Any): T = v.asInstanceOf[T] | |
| val v = BigInt(3) | |
| cast[Double](v) // no exception, there should be one | |
| cast1[Double](v) // exception, but from repl code after cast1 itself |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment