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

test-826.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bda94deda68daf1041a567ce24a7e7b844cdc3a7 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Reflection;

public interface I
{
	int Foo ();
}

public class A : I
{
	int I.Foo ()
	{
		Console.WriteLine ("a");
		return 1;
	}
}

public class AA : A, I
{
	public int Foo ()
	{
		Console.WriteLine ("aa");
		return 2;
	}
}

public class B : A
{
	public int Foo ()
	{
		Console.WriteLine ("b");
		return 3;
	}
}

public class Test
{
	public static int Main ()
	{
		I i = new AA ();
		if (i.Foo () != 2)
			return 1;
		
		i = new B ();
		if (i.Foo () != 1)
			return 2;
		
		var m = typeof (B).GetMethod ("Foo");
		Console.WriteLine (m.Attributes);
		if (m.Attributes != (MethodAttributes.Public | MethodAttributes.HideBySig))
			return 3;
		
		return 0;
	}
}