Created
September 15, 2014 19:25
-
-
Save arkadius/ec65933565af080e0350 to your computer and use it in GitHub Desktop.
This file contains 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 casted: T = value match { | |
case t: T => t | |
case _ => throw new ClassCastException(s"Cannot cast $value to expected type") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment