using System; using System.Collections; using System.Collections.Generic; public class Qux : IEnumerable where V : IComparable { public IEnumerator GetEnumerator() { yield break; } IEnumerator IEnumerable.GetEnumerator() { yield break; } } public class Foo : Qux where V : IComparable { } public class Test : IComparable> { public int CompareTo (Test t) { return 0; } } class X { static void Main () { Foo> foo = new Foo> (); foreach (Test test in foo) ; } }