Initial set of Ward sgen annotations (#5705)
[mono.git] / mcs / tests / test-iter-18.cs
1 // Test case for Bug #75934
2 // Checks for duplicate field names
3
4 using System;
5 using System.Collections;
6 using System.Reflection;
7
8 class test
9 {
10         public IEnumerable testen (int x)
11         {
12                 for (int i = 0;i < x; i++)
13                         if (i % 2 == 0) {
14                                 int o = i;
15                                 yield return o;
16                         } else {
17                                 int o = i*2;
18                                 yield return o;
19                         }
20         }
21 }
22
23 class reflect
24 {
25         public static void Main (string [] args)
26         {
27                 Hashtable ht = new Hashtable ();
28                 Assembly asm = Assembly.GetAssembly (typeof (test));
29                 foreach (Type t in asm.GetTypes ()) {
30                         ht.Clear ();
31                         foreach (FieldInfo fi in t.GetFields (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
32                                 ht.Add (fi.Name, fi);
33                 }
34         }
35 }