// // Important test for the runtime: check whether we're correctly // creating the vtable for nested types. // using System; interface IMonkey { T Jump (); } class Zoo { T t; public Zoo (T t) { this.t = t; } public T Name { get { return t; } } public IMonkey GetTheMonkey (U u) { return new Monkey (this, u); } public class Monkey : IMonkey { public readonly Zoo Zoo; public readonly W Data; public Monkey (Zoo zoo, W data) { this.Zoo = zoo; this.Data = data; } public W Jump () { Console.WriteLine ("Monkey {0} from {1} jumping!", Data, Zoo.Name); return Data; } } } class X { public static void Main () { Zoo zoo = new Zoo ("Boston"); IMonkey monkey = zoo.GetTheMonkey (3.14F); monkey.Jump (); } }