# generic version class Test implements IEnumerable var _records = List() cue init base.init get count as int return _records.count def getEnumerator as IEnumerator return _records.getEnumerator def getEnumerator as System.Collections.IEnumerator implements System.Collections.IEnumerable return .getEnumerator class Record get x as int return 5 class Program def main is shared pass def foo(t as Test) for r in t assert r.x == 5 list = List(t) assert list.count == t.count