ChangeLog entries
[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\r
2 // Line: 22\r
3 \r
4 public class UserOperatorClass\r
5 {\r
6         public static bool operator & (UserOperatorClass u1, UserOperatorClass u2) {\r
7                 return true;\r
8         }\r
9     \r
10         public static bool operator true (UserOperatorClass u) {\r
11                 return true;\r
12         }\r
13 \r
14         public static bool operator false (UserOperatorClass u) {\r
15                 return false;\r
16         }\r
17 \r
18         public static void Main () {\r
19                 \r
20                 UserOperatorClass x = new UserOperatorClass();\r
21                 UserOperatorClass y = new UserOperatorClass();\r
22                 UserOperatorClass z = x && y;\r
23         }\r
24 }\r
25 \r
26 \r