Browse Source

Modules that contain inner nested and outer subtypes are now loaded properly.

pull/1399/head
LtLi0n 5 years ago
parent
commit
852690e04a
1 changed files with 2 additions and 8 deletions
  1. +2
    -8
      src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs

+ 2
- 8
src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs View File

@@ -122,22 +122,16 @@ namespace Discord.Commands
///<summary>Just a helper method to avoid duplicate code</summary>
private static IEnumerable<TypeInfo> ResolveDependencies(TypeInfo typeInfo, IReadOnlyDictionary<TypeInfo, List<TypeInfo>> dependencies)
{
IEnumerable<TypeInfo> childTypes = null;
var childTypes = new List<TypeInfo>(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;
}



Loading…
Cancel
Save