diff options
author | Marek Safar <marek.safar@gmail.com> | 2008-04-02 19:28:18 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2008-04-02 19:28:18 +0400 |
commit | a5e24b4d9dc72c4ae11ad4300630a72d00a704e7 (patch) | |
tree | 0d442fac57305bf9a5090ed65e616beb0624cfe0 /mcs/errors/cs0217-2.cs | |
parent | 93c9c1b8bb3a95e532b9188a71e64ddf94efaf9b (diff) |
New tests, msg updates.
svn path=/trunk/mcs/; revision=99639
Diffstat (limited to 'mcs/errors/cs0217-2.cs')
-rw-r--r-- | mcs/errors/cs0217-2.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mcs/errors/cs0217-2.cs b/mcs/errors/cs0217-2.cs new file mode 100644 index 00000000000..1902e6b5904 --- /dev/null +++ b/mcs/errors/cs0217-2.cs @@ -0,0 +1,29 @@ +// CS0217: A user-defined operator `UserOperatorClass.operator &(UserOperatorClass, bool)' must have parameters and return values of the same type in order to be applicable as a short circuit operator +// Line: 25 + +public class UserOperatorClass +{ + public static UserOperatorClass operator & (UserOperatorClass u1, bool u2) + { + return u1; + } + + 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 (); + bool y = true; + UserOperatorClass z = x && y; + } +} + + |