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

test-925.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5e9ececb61e4ab43d068bc3d0ac63e109baf2a8a (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
using System;
using System.Linq;
using System.Reflection;

class Program
{
	public static int Main ()
	{
		var setter = typeof (MyClass).GetMember("set_Item")[0] as MethodInfo;
		var sp = setter.GetParameters ();
		var first = sp [0].GetCustomAttributes ();
		var value = sp [2].GetCustomAttributes ();

		if (first.Count () != 0)
			return 1;

		if (value.Count () != 1)
			return 2;
			
		return 0;
	}
}

[AttributeUsage(AttributeTargets.All)]
public class MyAttribute2Attribute : Attribute
{
}

public class MyClass
{
	public string this[int index1, int index2]
	{
		get
		{
			return "";
		}

		[param: MyAttribute2]
		set
		{
		}
	}
}