Author: martin
Date: 2005-04-15 12:03:30 -0400 (Fri, 15 Apr 2005)
New Revision: 43056

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/typemanager.cs
Log:
**** Merged r41636 from MCS ****


Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-04-15 16:02:37 UTC (rev 43055)
+++ trunk/mcs/gmcs/ChangeLog    2005-04-15 16:03:30 UTC (rev 43056)
@@ -1,3 +1,9 @@
+2005-03-10  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       Fix #73516.
+       * typemanager.cs (ComputeNamespaces): Import namespaces from
+       referenced modules too.
+
 2005-03-09  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * class.cs (TypeContainer.AddToMemberContainer): Use "." rather

Modified: trunk/mcs/gmcs/typemanager.cs
===================================================================
--- trunk/mcs/gmcs/typemanager.cs       2005-04-15 16:02:37 UTC (rev 43055)
+++ trunk/mcs/gmcs/typemanager.cs       2005-04-15 16:03:30 UTC (rev 43056)
@@ -779,6 +779,8 @@
        {
                MethodInfo assembly_get_namespaces = typeof 
(Assembly).GetMethod ("GetNamespaces", 
BindingFlags.Instance|BindingFlags.NonPublic);
 
+               Hashtable cache = null;
+
                //
                // First add the assembly namespaces
                //
@@ -795,7 +797,7 @@
                                }
                        }
                } else {
-                       Hashtable cache = new Hashtable ();
+                       cache = new Hashtable ();
                        cache.Add ("", null);
                        foreach (Assembly a in assemblies) {
                                foreach (Type t in a.GetExportedTypes ()) {
@@ -808,6 +810,25 @@
                                }
                        }
                }
+
+               //
+               // Then add module namespaces
+               //
+               foreach (Module m in modules) {
+                       if (m == CodeGen.Module.Builder)
+                               continue;
+                       if (cache == null) {
+                               cache = new Hashtable ();
+                               cache.Add ("", null);
+                       }
+                       foreach (Type t in m.GetTypes ()) {
+                               string ns = t.Namespace;
+                               if (ns == null || cache.Contains (ns))
+                                       continue;
+                               Namespace.LookupNamespace (ns, true);
+                               cache.Add (ns, null);
+                       }
+               }
        }
 
        /// <summary>

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to