using System.Collections.Generic; public class ClassA {}; public interface IGen { Dictionary makeDict (); } public class Gen : IGen { public Dictionary makeDict () { return new Dictionary (); } } public class Gen2 { public Dictionary makeDict (IGen igt) { return igt.makeDict (); } } public class main { public static int Main () { Gen gs = new Gen (); Gen2 g2so = new Gen2 (); Gen2 g2ss = new Gen2 (); Gen2 g2sa = new Gen2 (); Gen2 g2si = new Gen2 (); if (g2so.makeDict (gs).GetType () != typeof (Dictionary)) return 1; if (g2ss.makeDict (gs).GetType () != typeof (Dictionary)) return 1; if (g2sa.makeDict (gs).GetType () != typeof (Dictionary)) return 1; if (g2si.makeDict (gs).GetType () != typeof (Dictionary)) return 1; return 0; } }