blob: 19ebf8a05f645de44bc15c37a07fe874bfb867b2 (
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
|
using System;
class D
{
int arg;
public D (int arg)
{
this.arg = arg;
}
public static D operator & (D x, D y)
{
return new D (100);
}
public static bool operator false (D d)
{
return false;
}
public static bool operator true (D d)
{
return true;
}
public static implicit operator D(bool b)
{
return new D (5);
}
static int Main ()
{
D d = false && new D (1);
Console.WriteLine (d.arg);
if (d.arg != 100)
return 1;
Console.WriteLine ("ok");
return 0;
}
}
|