Skip to content

Instantly share code, notes, and snippets.

@mandel-macaque
Last active April 8, 2020 23:03
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 mandel-macaque/c959a87b8df9d756aa6a5b21e022747a to your computer and use it in GitHub Desktop.
Save mandel-macaque/c959a87b8df9d756aa6a5b21e022747a to your computer and use it in GitHub Desktop.
class MyClass ()
{
}
class YourClass ()
{
}
static void Print(MyClass o)
{
Console.WriteLine ("My class!");
}
static void Print(YourClass o)
{
Console.WriteLine ("Your class");
{
static void Main ()
{
MyClass o;
Print (o ?? new YouClass);
}
class MyClass ()
{
}
class YourClass ()
{
}
static void Print(MyClass o)
{
Console.WriteLine ("My class!");
}
static void Print(YourClass o)
{
Console.WriteLine ("Your class");
{
static void Main ()
{
MyClass o;
if (o == null)
Print(new YourClass());
else
Print (o);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment