[svn] r6263: nemerle/trunk/ncc: external/LibrariesLoader.n testsuite/positive/names-lookup-lib.n testsuite...

nazgul svnadmin at nemerle.org
Sat May 13 14:15:05 CEST 2006


Log:
Mark parent namespaces when loading external code

Author: nazgul
Date: Sat May 13 14:15:02 2006
New Revision: 6263

Added:
   nemerle/trunk/ncc/testsuite/positive/names-lookup-lib.n   (contents, props changed)
Modified:
   nemerle/trunk/ncc/external/LibrariesLoader.n
   nemerle/trunk/ncc/testsuite/positive/names-lookup.n

Modified: nemerle/trunk/ncc/external/LibrariesLoader.n
==============================================================================
--- nemerle/trunk/ncc/external/LibrariesLoader.n	(original)
+++ nemerle/trunk/ncc/external/LibrariesLoader.n	Sat May 13 14:15:02 2006
@@ -441,8 +441,12 @@
     internal cache_namespace_node (namespc : string) : NamespaceTree.Node
     {
       def nd = NamespaceTree.ExactPath (NString.Split (namespc, array ['.']));
-      when (nd.Value is NamespaceTree.TypeInfoCache.No)
-        nd.Value = NamespaceTree.TypeInfoCache.NamespaceReference ();
+      mutable assigned = nd;
+      while (assigned != null) {
+        when (assigned.Value is NamespaceTree.TypeInfoCache.No)
+          assigned.Value = NamespaceTree.TypeInfoCache.NamespaceReference ();
+        assigned = assigned.Parent;
+      }
       namespace_nodes.Add (namespc, nd);
       nd
     }

Added: nemerle/trunk/ncc/testsuite/positive/names-lookup-lib.n
==============================================================================
--- (empty file)
+++ nemerle/trunk/ncc/testsuite/positive/names-lookup-lib.n	Sat May 13 14:15:02 2006
@@ -0,0 +1,13 @@
+namespace Composed1.Composed2
+{
+
+  using System;
+  
+  public class  Class1 {
+  
+      public this () {}
+      
+      public Hello () : void { Console.WriteLine ("NS1.NS2.Class1.Hello") } 
+      
+  }
+}

Modified: nemerle/trunk/ncc/testsuite/positive/names-lookup.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/names-lookup.n	(original)
+++ nemerle/trunk/ncc/testsuite/positive/names-lookup.n	Sat May 13 14:15:02 2006
@@ -82,6 +82,7 @@
 			mutable  a =  X();
 			_ = a.x();
                         _ = a.Y;
+      Composed3.Class2.Run ();
 		}
 
 		public Y : Y {
@@ -182,11 +183,36 @@
   }
 }
 
+namespace Composed3
+{
+
+  using Composed1;
+  using System.CodeDom;
+  
+  public class Class2 {
+    
+    this () {
+        def t = Composed2.Class1();
+        t.Hello ();
+    }
+    
+    public static Run () : void {
+        _ = Class2();
+    
+    }
+  }
+}
+
+
+
 
 /*
+REFERENCE: names-lookup-lib.dll
+
 BEGIN-OUTPUT
 constructing NullEnumerable()
 in NullEnumerable
 constructing Y()
+NS1.NS2.Class1.Hello
 END-OUTPUT
 */



More information about the svn mailing list