blob: b79d8a3d126f3e2b0a7469945bd94404a88c4476 (
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
64
|
using System;
public struct S
{
public static bool operator true (S s)
{
throw new ApplicationException ();
}
public static bool operator false (S s)
{
return true;
}
public static string operator ! (S s)
{
throw new ApplicationException ();
}
}
class C
{
static bool Throw ()
{
throw new ApplicationException ("error");
}
static bool Return (bool value)
{
return value;
}
public static int Main ()
{
dynamic d = 4;
if (Return (false) && d)
return 1;
if (Return (true) || d) {
} else {
return 2;
}
d = false;
if (d && Throw ())
return 3;
d = true;
if (d || Throw ()) {
} else {
return 4;
}
dynamic a = new S ();
dynamic b = new S ();
var result = a && b;
Console.WriteLine ("ok");
return 0;
}
}
|