// // Another important test: nested generic types. // using System; class Queue { public Queue (T first, T second) { head = new Node (null, second); head = new Node (head, first); } protected Node head; protected Node GetFoo () { return head; } protected Node Foo { get { return GetFoo (); } } protected void Test (T t) { Console.WriteLine (t); } public void Test () { Test (head.Item); Test (head.Next.Item); Test (GetFoo ().Item); Test (Foo.Item); } protected class Node { public readonly U Item; public readonly Node Next; public Node (Node next, U item) { this.Next = next; this.Item = item; } } } class X { public static void Main () { Queue queue = new Queue (5, 9); queue.Test (); } }