From cd3d23e40645ea89d64cf8d01a862f8edb3b483b Mon Sep 17 00:00:00 2001 From: ElektroKill Date: Sat, 19 Nov 2022 11:09:13 +0100 Subject: [PATCH] Include property and event return types in `RequiredNamespaceCollector` --- ICSharpCode.Decompiler/CSharp/RequiredNamespaceCollector.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ICSharpCode.Decompiler/CSharp/RequiredNamespaceCollector.cs b/ICSharpCode.Decompiler/CSharp/RequiredNamespaceCollector.cs index 459a71a142..bdb77fab44 100644 --- a/ICSharpCode.Decompiler/CSharp/RequiredNamespaceCollector.cs +++ b/ICSharpCode.Decompiler/CSharp/RequiredNamespaceCollector.cs @@ -137,11 +137,13 @@ void CollectNamespaces(IEntity entity, MetadataModule module, CodeMappingInfo ma break; case IProperty property: HandleAttributes(property.GetAttributes()); + CollectNamespacesForTypeReference(property.ReturnType); CollectNamespaces(property.Getter, module, mappingInfo); CollectNamespaces(property.Setter, module, mappingInfo); break; case IEvent @event: HandleAttributes(@event.GetAttributes()); + CollectNamespacesForTypeReference(@event.ReturnType); CollectNamespaces(@event.AddAccessor, module, mappingInfo); CollectNamespaces(@event.RemoveAccessor, module, mappingInfo); break;