using System.Collections.Generic; class Test { static U[] Foo (T[] arg) where T : class, U { return arg; } static void TestByRef () { T[] array = new T[10]; PassByRef (ref array[0]); } static void PassByRef (ref T t) { t = default (T); } public static int Main () { foreach (var e in Foo (new string[] { "as" })) { } TestByRef (); return 0; } }