From 7934663bb834e35e0f9d192d8574fc903695bcdf Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Thu, 2 Apr 2015 15:43:33 -0400 Subject: [PATCH] [linker] Ensure updated Scope for exported types (e.g. unlinked PCL facade assemblies in a Nuget) [#28617] --- mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs b/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs index 9bd2bad9344..d7be23ac9e3 100644 --- a/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs +++ b/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs @@ -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 -- 2.25.1