6 public delegate string[] StringArrayDelegate ();
9 static bool checkArr<S> (Array arr, int length) {
10 if (arr.GetType () != typeof (S[]))
12 if (arr.Length != length)
18 return checkArr<ClassB> (newArr<ClassB> (), myLength ());
21 public virtual int myLength () {
25 public virtual S[] newArr<S> () {
30 public class GenSub<T> : Gen<T> {
31 public override int myLength () {
35 public override S[] newArr<S> () {
40 public class GenSubSub : GenSub<ClassA> {
41 public override int myLength () {
45 public override S[] newArr<S> () {
49 public static S[] staticNewArr<S> () {
55 public static int Main () {
56 Gen<ClassA> ga = new Gen<ClassA> ();
57 Gen<ClassA> gsa = new GenSub<ClassA> ();
58 Gen<ClassA> gss = new GenSubSub ();
61 for (i = 0; i < 100; ++i) {
69 StringArrayDelegate sad = new StringArrayDelegate (GenSubSub.staticNewArr<string>);
70 string[] arr = sad ();
71 if (arr.GetType () != typeof (string[]))
76 sad = new StringArrayDelegate (gss.newArr<string>);
78 if (arr.GetType () != typeof (string[]))