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

test-814.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d6a9e76dea361459bb49d7551351bb21393e2d6a (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
// Compiler options: -r:../class/lib/net_4_x/Mono.Cecil.dll

using System;
using Mono.Cecil;

class Test
{
	public static string A
	{
		get { return ""; }
	}

	public string B
	{
		get { return ""; }
	}

	public static int Main ()
	{
		var assembly = AssemblyDefinition.ReadAssembly (typeof (Test).Assembly.Location);
		var t = assembly.MainModule.GetType ("Test");
		foreach (var p in t.Properties)
		{
			switch (p.Name) {
			case "A":
				if (!p.HasThis)
					break;
				
				return 1;
			case "B":
				if (p.HasThis)
					break;
				
				return 2;
			default:
				return 3;
			}
		}
		
		return 0;
	}
}