Don't attempt to load types with generic parameters as a module

This fixes an issue where custom ModuleBases that contained a generic
parameter would be loaded as a module - only to fail when trying to be
built.

Realistically, ModuleBases _should_ be abstract - but it was still a bug
that we allowed them to be included as a module.
This commit is contained in:
Christopher F
2018-02-26 19:32:26 -05:00
parent fda19b5a8f
commit b1eaa44021

View File

@@ -307,7 +307,8 @@ namespace Discord.Commands
private static bool IsValidModuleDefinition(TypeInfo typeInfo) private static bool IsValidModuleDefinition(TypeInfo typeInfo)
{ {
return _moduleTypeInfo.IsAssignableFrom(typeInfo) && return _moduleTypeInfo.IsAssignableFrom(typeInfo) &&
!typeInfo.IsAbstract; !typeInfo.IsAbstract &&
!typeInfo.ContainsGenericParameters;
} }
private static bool IsValidCommandDefinition(MethodInfo methodInfo) private static bool IsValidCommandDefinition(MethodInfo methodInfo)