using System; using System.Collections; namespace Tests { class Constraints { class Dicto : Dictionary { } public static bool Method1(IEnumerator param1) { return true; } public static bool Method2(TEnumerator param1) where TEnumerator : IEnumerator { for (let val in param1) { } return true; } public static bool Method3(Dictionary param1) where K : IHashable { Method1(param1.GetEnumerator()); Method1((IEnumerator<(K key, V value)>)param1.GetEnumerator()); return Method2.Enumerator, (K key, V value)>(param1.GetEnumerator()); } [Test] public static void TestBasics() { Dicto dicto = scope .(); Method3(dicto); } } }