using System; using System.Collections.Generic; interface I : ICollection, IEnumerable { } class C { void Foo () { I o = null; foreach (var v in o) Console.WriteLine (v); } public static void Main () { IList list = new List { 1, 3 }; var g = list.GetEnumerator (); } }