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

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

class A
{
	public static int operator + (short x, A b)
	{
		return -1;
	}
	
	public static int operator - (A a)
	{
		return -1;
	}
}

class B : A
{
	public static int operator + (int x, B d)
	{
		return 1;
	}
	
	public static int operator - (B b)
	{
		return 1;
	}
}

class C : B
{
}

public class Test
{
	public static int Main ()
	{
		var b = new B ();
		short s = 3;
		var res = s + b;

		if (res != 1)
			return 1;
		
		var c = new C ();
		if (-c != 1)
			return 2;

		return 0;
	}
}