New test.
[mono.git] / mcs / errors / cs0217.cs
1 // cs0217.cs: In order to be applicable as a short circuit operator a user-defined logical operator `UserOperatorClass.operator &(UserOperatorClass, UserOperatorClass)' must have the same return type as the type of its 2 parameters
2 // Line: 22
3
4 public class UserOperatorClass
5 {
6         public static bool operator & (UserOperatorClass u1, UserOperatorClass u2) {
7                 return true;
8         }
9     
10         public static bool operator true (UserOperatorClass u) {
11                 return true;
12         }
13
14         public static bool operator false (UserOperatorClass u) {
15                 return false;
16         }
17
18         public static void Main () {
19                 
20                 UserOperatorClass x = new UserOperatorClass();
21                 UserOperatorClass y = new UserOperatorClass();
22                 UserOperatorClass z = x && y;
23         }
24 }
25
26