From 59260ced5ae1471fac9e50a3c08d3c90a1a3710d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 24 Aug 2016 12:12:48 +0200 Subject: [PATCH] =?utf8?q?[linker]=20Mark=20declaring=20types=20of=20neste?= =?utf8?q?d=20types=20resolved=20from=20xml=20descriptors.=20Fixes=C2=A0#4?= =?utf8?q?3658.=20(#3434)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If the declaring type of a nested type marked by an xml descriptor is not otherwise marked, the members of the nested type will not be preserved, because the linker will not process the nested type (since the parent type isn't marked, MarkStep:InitializeAssembly will skip it, and thus skip akk its nested types as well). https://bugzilla.xamarin.com/show_bug.cgi?id=43658 --- mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs b/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs index 5e9f681fd17..aa4f6afc760 100644 --- a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs +++ b/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs @@ -174,6 +174,14 @@ namespace Mono.Linker.Steps { Annotations.Mark (type); + if (type.IsNested) { + var parent = type; + while (parent.IsNested) { + parent = parent.DeclaringType; + Annotations.Mark (parent); + } + } + switch (preserve) { case TypePreserve.Nothing: if (!nav.HasChildren) -- 2.25.1