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

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

public class Test
{
	public static int Main ()
	{
		S a = new S ();
		S? b = null;
		var res = a | b;
		if (res != "op")
			return 1;
		
		var res2 = a + b;
		if (res2 != 9)
			return 2;

		return 0;
	}
}

struct S
{
	public static string operator | (S p1, S? p2)
	{ 
		return "op";
	}
	
	public static int? operator + (S p1, S? p2)
	{ 
		return 9;
	}
}