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-03-15 04:19:55 +0300
committerMiguel de Icaza <miguel@gnome.org>2002-03-15 04:19:55 +0300
commitaca81ed521c2611ef1bd7d55a85d08268ba1f61b (patch)
treec08fab7105042701c1f5332dd5e97bf20621179b /mcs/tests/test-87.cs
parent07fc29e0386752aa29b5db13c9518f046e777cf2 (diff)
2002-03-14 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs (ResolveTree): Always set the interface_resolve_order, because nested interfaces will be calling into us. * class.cs (GetInterfaceOrClass): Track the same resolution process used by TypeManager.LookupType. This fixes the nested type lookups in class declarations (separate path from LookupType). (TypeContainer.DefineType): Also define nested interfaces. (TypeContainer.RegisterOrder): New public function used to register the order in which child interfaces need to be closed. Nested interfaces need to be closed after their parents have been created. * interface.cs (InterfaceAttr): Put all the logic for computing the interface attribute here. (DefineInterface): Register our interface order with the RootContext or with the TypeContainer depending on the case. New test as well. svn path=/trunk/mcs/; revision=3115
Diffstat (limited to 'mcs/tests/test-87.cs')
-rwxr-xr-xmcs/tests/test-87.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/mcs/tests/test-87.cs b/mcs/tests/test-87.cs
new file mode 100755
index 00000000000..56c53c9c7ce
--- /dev/null
+++ b/mcs/tests/test-87.cs
@@ -0,0 +1,47 @@
+//
+// Tests the lookup of names on nested classes.
+//
+// Tests nested interfaces
+//
+class Top {
+
+ class X {
+
+ }
+
+ class Y : X {
+ }
+
+ interface A {
+ int get_one ();
+ }
+
+ interface B : A {
+ int get_two ();
+ }
+
+ class XA : A {
+ public int get_one () { return 1; }
+ }
+
+ class XB : B {
+ public int get_one () { return 1; }
+ public int get_two () { return 2; }
+ }
+
+ static int Main ()
+ {
+ XA x = new XA ();
+
+ if (x.get_one () != 1)
+ return 1;
+
+ XB b = new XB ();
+ if (x.get_one () != 1)
+ return 2;
+ if (b.get_two () != 2)
+ return 3;
+ return 0;
+ }
+}
+