blob: 2aeebb4e54ee53fe0f67ad29a97681d27cdd59ad (
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
|
using System;
public struct Test
{
public static Test op_Addition<T>(Test p1, T p2)
{
throw new ApplicationException ();
}
public static int op_Addition<T>(T p1, int p2)
{
throw new ApplicationException ();
}
public static Test operator +(Test p1, Test p2)
{
throw new ApplicationException ();
}
public static long operator +(Test p1, int p2)
{
return 4;
}
}
public class Program
{
public static int Main ()
{
var t = new Test ();
int p2 = 20;
var res = t + p2;
if (res != 4)
return 1;
return 0;
}
}
|