Skip to content

Instantly share code, notes, and snippets.

@vcsjones
Created August 17, 2011 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcsjones/1152258 to your computer and use it in GitHub Desktop.
Save vcsjones/1152258 to your computer and use it in GitHub Desktop.
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