// 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; using System.Collections.Generic; namespace E { public class BigG where T : new() { public static T GiveMe() { return new T(); } } public class Program { private static void Analyze(string prefix, Type t) { Console.WriteLine(prefix + "Type=" + t.Name); if (t.IsGenericType) { Type[] pa = t.GetGenericArguments(); foreach(Type p in pa) { Analyze(prefix + " ", p); } } } public static void Analyze(object o) { Analyze("", o.GetType()); } public static void Main(string[] args) { Analyze("ABC"); Analyze(BigG>.GiveMe()); Analyze(BigG>>.GiveMe()); } } }