9c958cb8d43152173a05a82fd60df36609426657
[mono.git] / mcs / tests / test-7.cs
1 using System;
2
3 namespace Mine {
4
5         public class Blah {
6
7                 public int i;
8
9                 public static void Main ()
10                 {
11                         Console.WriteLine ("Blah ");
12                         Blah k;
13
14                         k = new Blah () + new Blah (); 
15                         k = ~ new Blah ();
16                         k = + new Blah ();
17
18                         int number = k;
19                         Console.WriteLine (number);
20                         
21                         // Uncomment this to see how beautifully we catch errors :)
22                         // Console.WriteLine (k);
23                         
24                         //Console.WriteLine ("This is : " + number);
25                         
26                 }
27                 
28                 public static Blah operator + (Blah i, Blah j)
29                 {
30                         Console.WriteLine ("Wooo!");
31                         return null; 
32                 }
33
34                 public static Blah operator + (Blah i)
35                 {
36                         Console.WriteLine ("This is the unary one !");
37                         return null;
38                 }
39                 
40         
41                 public static Blah operator ~ (Blah i)
42                 {
43                         Console.WriteLine ("This is even better !");
44                         return null;
45                 }
46         
47                 public static implicit operator int (Blah i) 
48                 {       
49                         Console.WriteLine ("User-defined implicit conversion works !");
50                         return 3;
51                 }
52
53         }
54
55 }