summaryrefslogtreecommitdiff
path: root/mcs/tests/test-named-01.cs
blob: a87e76540516a3cf7d316a5308ab5f1fb38572a2 (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
56
57
58
59
60
61
62
63
using System;

class A
{
	public int Index;
	
	public A ()
		: this (x : 0)
	{
	}
	
	protected A (object x)
	{
	}
	
	public virtual int this [int i] {
		set {
			Index = value;
		}
	}
}

class B : A
{
	public B ()
		: base (x : "x")
	{
	}
	
	public override int this [int i] {
		set {
			base [i : i] = value + 4;
		}
	}
}

class XAttribute:Attribute
{
	public XAttribute (int h)
	{
	}
}

[X (h : 3)]
class M
{
	static void Foo (int a)
	{
	}
	
	public static int Main ()
	{
		Foo (a : -9);
		
		B b = new B ();
		b [8] = 5;
		if (b.Index != 9)
			return 1;
		
		Console.WriteLine ("ok");
		return 0;
	}
}