2010-05-11 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Tue, 11 May 2010 20:06:58 +0000 (20:06 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 11 May 2010 20:06:58 +0000 (20:06 -0000)
* namespace.cs: Ignore missing dependencies failure at
initialization.

svn path=/trunk/mcs/; revision=157156

mcs/mcs/ChangeLog
mcs/mcs/namespace.cs

index 1c5fbba4af6dd31739be1640433c67533c137eed..3cab048d42b778d4495339fe30295af324a0fe5c 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-11  Marek Safar  <marek.safar@gmail.com>
+
+       * namespace.cs: Ignore missing dependencies failure at
+       initialization.
+
 2010-05-11  Marek Safar  <marek.safar@gmail.com>
 
        A fix for bug #604640
index b8c9a7edd53be290cfeaef8064b13024da33eb5b..f56433740a9df5fe1f3602c4489144800f21e6a5 100644 (file)
@@ -89,10 +89,23 @@ namespace Mono.CSharp {
                                }
                        }
 
+                       //
+                       // This part tries to simulate loading of top-level
+                       // types only, any missing dependencies are ignores here.
+                       // Full error report is reported later when the type is
+                       // actually used
+                       //
+                       Type[] all_types;
+                       try {
+                               all_types = assembly.GetTypes ();
+                       } catch (ReflectionTypeLoadException e) {
+                               all_types = e.Types;
+                       }
+
                        Namespace ns = this;
                        string prev_namespace = null;
-                       foreach (var t in assembly.GetTypes ()) {
-                               if (t.IsNested)
+                       foreach (var t in all_types) {
+                               if (t == null || t.IsNested)
                                        continue;
 
                                if (t.Name[0] == '<')