Add Attribute generic constraint to IReflectionManager.FindTypesWithAttribute (#1548)

This commit is contained in:
DrSmugleaf
2021-02-14 02:14:00 +01:00
committed by GitHub
parent d9b2c73440
commit f05c1b2395
2 changed files with 2 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ namespace Robust.Shared.Reflection
/// </summary>
/// <typeparam name="T">Attribute to search for.</typeparam>
/// <returns>Enumeration of all types with the specified attribute.</returns>
IEnumerable<Type> FindTypesWithAttribute<T>();
IEnumerable<Type> FindTypesWithAttribute<T>() where T : Attribute;
/// <summary>
/// Loads assemblies into the manager and get all the types.

View File

@@ -159,7 +159,7 @@ namespace Robust.Shared.Reflection
}
/// <inheritdoc />
public IEnumerable<Type> FindTypesWithAttribute<T>()
public IEnumerable<Type> FindTypesWithAttribute<T>() where T : Attribute
{
var types = new List<Type>();