using System.Collections.Generic; using System.Runtime.CompilerServices; public class Gen { public T[] method () { return new T[3]; } public static T[] staticMethod () { return new T[3]; } public S[] genericMethod () { return new S[3]; } } public class main { static bool callMethod (Gen g) { return g.method ().GetType () == typeof (T[]); } static bool callStaticMethod () { return Gen.staticMethod ().GetType () == typeof (T[]); } static bool callGenericMethod (Gen g) { return g.genericMethod ().GetType () == typeof (S[]); } [MethodImpl (MethodImplOptions.NoInlining)] static bool work () { Gen g = new Gen (); if (!callMethod (g)) return false; if (!callStaticMethod ()) return false; if (!callGenericMethod (g)) return false; return true; } public static int Main () { if (!work ()) return 1; if (!work ()) return 1; if (!work ()) return 1; if (!work ()) return 1; return 0; } }