diff options
author | Miguel de Icaza <miguel@gnome.org> | 2003-11-11 20:34:37 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2003-11-11 20:34:37 +0300 |
commit | d4c562e554943bc448783686c0e74ad24b7b7042 (patch) | |
tree | 9f284d3f32fc57b908348b156a1e504e7e6f80af /mcs/errors/cs0217.cs | |
parent | 5540520e22e8975796a09c831e361ea1294d9562 (diff) |
Applied patch from Marek Safar: New error test files for MCS.
svn path=/trunk/mcs/; revision=19826
Diffstat (limited to 'mcs/errors/cs0217.cs')
-rw-r--r-- | mcs/errors/cs0217.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mcs/errors/cs0217.cs b/mcs/errors/cs0217.cs new file mode 100644 index 00000000000..f7f7687f254 --- /dev/null +++ b/mcs/errors/cs0217.cs @@ -0,0 +1,26 @@ +// 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
+// Line: 22
+
+public class UserOperatorClass
+{
+ public static bool operator & (UserOperatorClass u1, UserOperatorClass u2) {
+ return true;
+ }
+
+ public static bool operator true (UserOperatorClass u) {
+ return true;
+ }
+
+ public static bool operator false (UserOperatorClass u) {
+ return false;
+ }
+
+ public static void Main () {
+
+ UserOperatorClass x = new UserOperatorClass();
+ UserOperatorClass y = new UserOperatorClass();
+ UserOperatorClass z = x && y;
+ }
+}
+
+
|