+2003-12-22 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * test-221.cs: Add some regression tests relating to
+ 52408 (these dont test the actual bug, but regressions I
+ created while writing the code for it).
+
2003-12-20 Zoltan Varga <vargaz@freemail.hu>
* module-1.cs module-2.cs module-3.cs: New files.
test-181 test-182 test-183 test-184 test-185 test-186 test-187 test-188 test-189 test-190 \
test-191 test-192 test-193 test-194 test-195 test-196 test-197 test-198 test-199 test-200 \
test-201 test-202 test-203 test-204 test-205 test-206 test-207 test-208 test-209 test-210 \
- test-211 test-212 test-213 test-214 test-215 test-216 test-217 test-218 test-219 test-220
+ test-211 test-212 test-213 test-214 test-215 test-216 test-217 test-218 test-219 test-220 \
+ test-221
#
# C# 2.0 tests
* Indexers and Properties
- test-148.cs test-166.cs test-206.cs test-208.cs test-209.cs
+ test-148.cs test-166.cs test-206.cs test-208.cs test-209.cs test-221.cs
* Events and Delegates
Test for a bug in foreach, where it would pick the wrong GetEnumerator in a class.
Bug # was 51446
+test-221.cs:
+------------
+Test for correct scanning for base properties.
+
verify-1.cs
-----------
Test whether we do not jump out of the method in a Try/Finally block.
--- /dev/null
+//
+// Tests for bug # 52427 -- property inhertance stuff.
+// these tests are problems that cropped up while
+// making the patch. We dont want to regress on these.
+//
+
+class A { public virtual int Blah { get { return 1; } set {} } }
+
+class B : A {
+ public override int Blah { get { return 2; } }
+
+ public static bool Test ()
+ {
+ // Make sure we see that set in A
+
+ B b = new B ();
+
+ if (b.Blah != 2) return false;
+ if (b.Blah ++ != 2) return false;
+ b.Blah = 0;
+
+ return true;
+ }
+}
+
+abstract class C { public abstract int Blah { get; set; } }
+class D : C { public override int Blah { get { return 2; } set {} } }
+
+class E : D {
+ // Make sure we see that there is actually a base
+ // which we can call
+ public override int Blah { get { return base.Blah; } }
+
+ public static bool Test ()
+ {
+ E e = new E ();
+
+ if (e.Blah != 2) return false;
+ if (e.Blah ++ != 2) return false;
+ e.Blah = 2;
+
+ return true;
+ }
+}
+
+interface IBlah {
+ int this [int i] { get; set; }
+ int Blah { get; set; }
+}
+
+class F : IBlah {
+ int IBlah.this [int i] { get { return 1; } set {} }
+ int IBlah.Blah { get { return 1; } set {} }
+
+ public int this [int i] { get { return 2; } set {} }
+ public int Blah { get { return 2; } set {} }
+
+ public static bool Test ()
+ {
+ // Make sure we dont see a conflict between
+ // the explicit impl and the non interface version
+ F f = new F ();
+
+ if (f.Blah != 2) return false;
+ if (f.Blah ++ != 2) return false;
+ f.Blah = 2;
+
+
+ if (f [1] != 2) return false;
+ if (f [1] ++ != 2) return false;
+ f [1] = 2;
+
+ return true;
+ }
+}
+
+class Driver {
+ static int Main ()
+ {
+ if (! B.Test ()) return 1;
+ if (! E.Test ()) return 2;
+ if (! F.Test ()) return 3;
+
+ return 0;
+ }
+}
\ No newline at end of file