Skip to content

Instantly share code, notes, and snippets.

@VladimirReshetnikov
Created January 9, 2014 22:21
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 VladimirReshetnikov/8343177 to your computer and use it in GitHub Desktop.
Save VladimirReshetnikov/8343177 to your computer and use it in GitHub Desktop.
using System;
static class Program
{
static void Main()
{
Action action = ((object)0).Foo;
if (action.Target != null && action.Method.IsStatic)
{
Console.WriteLine(action.Target.GetType().IsValueType);
Console.WriteLine("Delegate from static method with target instance!?");
}
}
static void Foo<T>(this T x) { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment