1 // Compiler options: -langversion:default
4 using System
.Collections
;
7 static IEnumerator
GetIt ()
14 static IEnumerable
GetIt2 ()
23 IEnumerator e
= GetIt ();
26 while (e
.MoveNext ()){
27 Console
.WriteLine ("Value=" + e
.Current
);
28 total
+= (int) e
.Current
;
35 foreach (int i
in GetIt2 ()){
36 Console
.WriteLine ("Value=" + i
);