Created
August 17, 2011 18:30
-
-
Save vcsjones/1152258 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var foo = (MyType<string>) "cat"; | |
} | |
} | |
public class MyType<t> | |
{ | |
private t _value; | |
private MyType(t val) | |
{ | |
_value = val; | |
} | |
public static implicit operator MyType<t>(t obj) | |
{ | |
throw new Exception("WOOPS!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment