class X {} class Y : X {} class Test { static void f(ref X x){} static void Main() { X[] x = new Y[1]; f(ref x[0]); } }