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>2001-10-27 19:12:16 +0400
committerMiguel de Icaza <miguel@gnome.org>2001-10-27 19:12:16 +0400
commita7b03801a1f1bbb4feaa7f989773e0bdf9daa61b (patch)
tree7b153b0f088ca80e35cf1930c5ba6b3d80ce7ce3 /mcs/tests/test-29.cs
parent23d7ab9d3522538b2ab8262b34d976c3137e249d (diff)
Make the various versioning tests work
svn path=/trunk/mcs/; revision=1212
Diffstat (limited to 'mcs/tests/test-29.cs')
-rw-r--r--mcs/tests/test-29.cs18
1 files changed, 15 insertions, 3 deletions
diff --git a/mcs/tests/test-29.cs b/mcs/tests/test-29.cs
index b33e52451a9..6183126d277 100644
--- a/mcs/tests/test-29.cs
+++ b/mcs/tests/test-29.cs
@@ -1,28 +1,40 @@
//
// Versioning, should choose Derived.Add (1)
//
+using System;
+
class Base {
public int val;
- void Add (int x)
+ public void Add (int x)
{
+ Console.WriteLine ("Incorrect method called");
+
val = 1;
}
}
class Derived : Base {
- void Add (double x)
+ public void Add (double x)
{
+ Console.WriteLine ("Calling the derived class with double! Excellent!");
val = 2;
}
}
class Demo {
- static void Main ()
+ static int Main ()
{
Derived d = new Derived ();
d.Add (1);
+ if (d.val == 1)
+ return 1;
+
+ if (d.val == 2)
+ return 0;
+ return 2;
+
}
}