Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnome.org>2002-01-03 04:58:48 +0300
committerMiguel de Icaza <miguel@gnome.org>2002-01-03 04:58:48 +0300
commit5d388d9d684c8095d84de537ee2a63f050e6f68d (patch)
treed27eef843297bf978e44fd28111678be074edb76 /mcs/tests/test-70.cs
parented0239040063ef73396b0c9db79a27999b2a7d58 (diff)
Add new test
svn path=/trunk/mcs/; revision=1785
Diffstat (limited to 'mcs/tests/test-70.cs')
-rwxr-xr-xmcs/tests/test-70.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/mcs/tests/test-70.cs b/mcs/tests/test-70.cs
new file mode 100755
index 00000000000..92ea12f2ab3
--- /dev/null
+++ b/mcs/tests/test-70.cs
@@ -0,0 +1,48 @@
+//
+// Tests the right settings for overrides
+//
+
+class X {
+
+ public virtual int A {
+ get {
+ return 1;
+ }
+ }
+
+ public virtual int B ()
+ {
+ return 1;
+ }
+}
+
+class Y : X {
+ public override int A {
+ get {
+ return base.A + 2;
+ }
+ }
+
+ public override int B ()
+ {
+ return base.B () + 1;
+ }
+}
+
+class Z {
+ static int Main ()
+ {
+ Y y = new Y ();
+ X x = new X ();
+
+ if (y.B () != 2)
+ return 1;
+ if (y.A != 2)
+ return 2;
+ if (x.A != 1)
+ return 3;
+ if (x.B () != 1)
+ return 4;
+ return 0;
+ }
+}