// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class Foo { public void Test1() { Console.WriteLine(typeof(T).FullName); } public static void Test2() { Console.WriteLine(typeof(T).FullName); } public void Test3(T o) { Console.WriteLine(typeof(T).FullName); } public static void Test4(T o) { Console.WriteLine(typeof(T).FullName); } } public class Bar { public void Test1() { Console.WriteLine(typeof(T).FullName); } public static void Test2() { Console.WriteLine(typeof(T).FullName); } public void Test3(T o) { Console.WriteLine(typeof(T).FullName); } public static void Test4(T o) { Console.WriteLine(typeof(T).FullName); } } public class Program { public static void Main(string[] args) { Foo foo = new Foo(); foo.Test1(); Foo.Test2(); foo.Test3(123); Foo.Test4(123); Bar bar = new Bar(); bar.Test1(); Bar.Test2(); bar.Test3(123); Bar.Test4(123); // <---- deviation } } }