[linker] Ensure updated Scope for exported types (e.g. unlinked PCL facade assemblies...
authorSebastien Pouliot <sebastien@xamarin.com>
Thu, 2 Apr 2015 19:43:33 +0000 (15:43 -0400)
committerSebastien Pouliot <sebastien@xamarin.com>
Thu, 2 Apr 2015 19:43:33 +0000 (15:43 -0400)
mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs

index 9bd2bad93444e1d258faa01310f7b4b7b0600571..d7be23ac9e33dbbd87eb856657dcb727a6e5d837 100644 (file)
@@ -144,6 +144,16 @@ namespace Mono.Linker.Steps {
                                        scope = assembly.MainModule.Import (td).Scope;
                                hash.Add (tr, scope);
                        }
+                       if (assembly.MainModule.HasExportedTypes) {
+                               foreach (var et in assembly.MainModule.ExportedTypes) {
+                                       var td = et.Resolve ();
+                                       IMetadataScope scope = et.Scope;
+                                       if ((td != null) && Annotations.IsMarked (td)) {
+                                               scope = assembly.MainModule.Import (td).Scope;
+                                               hash.Add (td, scope);
+                                       }
+                               }
+                       }
 
                        // Resolve everything first before updating scopes.
                        // If we set the scope to null, then calling Resolve() on any of its