Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-iter-18.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9fd5e19bbd70e1907ded082686791e15ed59dba2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Test case for Bug #75934
// Checks for duplicate field names

using System;
using System.Collections;
using System.Reflection;

class test
{
        public IEnumerable testen (int x)
        {
                for (int i = 0;i < x; i++)
                        if (i % 2 == 0) {
                                int o = i;
                                yield return o;
                        } else {
                                int o = i*2;
                                yield return o;
                        }
        }
}

class reflect
{
	public static void Main (string [] args)
	{
		Hashtable ht = new Hashtable ();
		Assembly asm = Assembly.GetAssembly (typeof (test));
		foreach (Type t in asm.GetTypes ()) {
			ht.Clear ();
			foreach (FieldInfo fi in t.GetFields (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
				ht.Add (fi.Name, fi);
		}
	}
}