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