2 using System
.Collections
.Generic
;
6 public static int Main ()
8 foreach (var x
in Test1 ("2"))
10 Console
.WriteLine (x
);
14 foreach (var x
in Test2 (2))
16 Console
.WriteLine (x
);
23 public static IEnumerable
<object> Test1 (object expr
)
25 if (expr
is short list
)
27 yield return "list.Length";
31 public static IEnumerable
<object> Test2 (object expr
)
33 if (expr
is string list
)
35 yield return "list.Length";