* test-204.cs: User defined conditional logical operators; bug #40505.
2003-07-14 Martin Baulig <martin@ximian.com>
* test-203.cs: Added test for bug #33026.
svn path=/trunk/mcs/; revision=16226
+2003-07-14 Martin Baulig <martin@ximian.com>
+
+ * test-204.cs: User defined conditional logical operators; bug #40505.
+
+2003-07-14 Martin Baulig <martin@ximian.com>
+
+ * test-203.cs: Added test for bug #33026.
+
2003-07-13 Ravi Pratap M <ravi@ximian.com>
* test-178.cs: Use this as it is a free slot. Test
test-161 test-162 test-163 test-164 test-165 test-166 test-167 test-168 test-169 test-170 \
test-172 test-173 test-174 test-175 test-176 test-177 test-179 test-180 \
test-181 test-182 test-183 test-184 test-185 test-186 test-187 test-188 test-190 \
- test-191 test-192 test-193 test-194 test-195 test-197 test-198 test-199
+ test-191 test-192 test-193 test-194 test-195 test-197 test-198 test-199 test-200 \
+ test-201 test-202 test-203 test-204
+
#
# NOTE: Slot test-178 is free, turns out it was an unsafe test.
* Operators
- test-146.cs test-175.cs test-200.cs
+ test-146.cs test-175.cs test-200.cs test-204.cs
* Overloading
* Type resolution and name lookup
- test-198.cs test-201.cs test-202.cs
+ test-198.cs test-201.cs test-202.cs test-203.cs
Test cases listed by Number:
============================
test-201.cs
-----------
-Fix for Bug #35631.
+Fix for bug #35631.
+
+test-202.cs
+-----------
+
+Fix for bug #41975.
+
+test-203.cs
+-----------
+
+Fix for bug #33026.
+
+test-204.cs
+-----------
+
+User defined conditional logical operators; bug #40505.
verify-1.cs
-----------
--- /dev/null
+public enum Modifiers
+{
+ Public = 0x0001
+}
+
+class Foo
+{
+ internal Modifiers Modifiers {
+ get {
+ return Modifiers.Public;
+ }
+ }
+}
+
+class Bar
+{
+ public static int Main ()
+ {
+ System.Console.WriteLine (Modifiers.Public);
+ return 0;
+ }
+}
--- /dev/null
+using System;
+
+class X
+{
+ public readonly int x;
+
+ public X (int x)
+ {
+ this.x = x;
+ }
+
+ public override string ToString ()
+ {
+ return String.Format ("X ({0})", x);
+ }
+
+ public static X operator & (X a, X b)
+ {
+ return new X (a.x * b.x);
+ }
+
+ public static X operator | (X a, X b)
+ {
+ return new X (a.x + b.x);
+ }
+
+ // Returns true if the value is odd.
+ public static bool operator true (X x)
+ {
+ return (x.x % 2) != 0;
+ }
+
+ // Returns true if the value is even.
+ public static bool operator false (X x)
+ {
+ return (x.x % 2) == 0;
+ }
+
+ public static int Test ()
+ {
+ X x = new X (3);
+ X y = new X (4);
+
+ X t1 = x && y;
+ X t2 = y && x;
+ X t3 = x || y;
+ X t4 = y || x;
+
+ // Console.WriteLine ("TEST: {0} {1} {2} {3} {4} {5}", x, y, t1, t2, t3, t4);
+
+ if (t1.x != 12)
+ return 1;
+ if (t2.x != 4)
+ return 2;
+ if (t3.x != 3)
+ return 3;
+ if (t4.x != 7)
+ return 4;
+
+ return 0;
+ }
+
+ public static int Main ()
+ {
+ int result = Test ();
+ Console.WriteLine ("RESULT: {0}", result);
+ return result;
+ }
+}