From 852690e04a2455d5c12a3f0c91ed8417c3fabec6 Mon Sep 17 00:00:00 2001 From: LtLi0n Date: Thu, 31 Oct 2019 13:41:38 +0200 Subject: [PATCH] Modules that contain inner nested and outer subtypes are now loaded properly. --- .../Builders/ModuleClassBuilder.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs b/src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs index dc02d2a43..186754bda 100644 --- a/src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs +++ b/src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs @@ -122,22 +122,16 @@ namespace Discord.Commands ///Just a helper method to avoid duplicate code private static IEnumerable ResolveDependencies(TypeInfo typeInfo, IReadOnlyDictionary> dependencies) { - IEnumerable childTypes = null; + var childTypes = new List(typeInfo.DeclaredNestedTypes); if (dependencies != null) { if (dependencies.TryGetValue(typeInfo, out var linkedChildTypes)) { - childTypes = linkedChildTypes; + childTypes.AddRange(linkedChildTypes); } } - //??= pls when 8.0 - if (childTypes == null) - { - childTypes = typeInfo.DeclaredNestedTypes; - } - return childTypes; }