Take stars out of types where they make more sense.
[mono-project.git] / mcs / tests / test-244.cs
blobc4838dfe43506cd4659935e4d9e34b0c1f7a889a
1 using System;
3 class Foo {
4 static int t_count = 0, f_count = 0;
6 public static int Main ()
8 Console.WriteLine (t && f);
9 if (t_count != 1)
10 return 1;
11 if (f_count != 1)
12 return 2;
13 Console.WriteLine ();
14 Console.WriteLine (t && t);
15 if (t_count != 3)
16 return 3;
17 if (f_count != 1)
18 return 4;
19 Console.WriteLine ();
20 return 0;
23 static MyBool t { get { Console.WriteLine ("t"); t_count++; return new MyBool (true); }}
24 static MyBool f { get { Console.WriteLine ("f"); f_count++; return new MyBool (false); }}
27 public struct MyBool {
28 bool v;
30 public MyBool (bool v) { this.v = v; }
32 public static MyBool operator & (MyBool x, MyBool y) {
33 return new MyBool (x.v & y.v);
36 public static MyBool operator | (MyBool x, MyBool y) {
37 return new MyBool (x.v | y.v);
40 public static bool operator true (MyBool x) {
41 return x.v;
44 public static bool operator false (MyBool x) {
45 return ! x.v;
48 public override string ToString () { return v.ToString (); }