Fix collection type in `ServiceNotApplicableAttribute`

This commit is contained in:
YoshiRulz 2024-09-26 13:23:34 +10:00
parent bcd13fe37f
commit f056059e48
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 3 additions and 7 deletions

View File

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq;
namespace BizHawk.Emulation.Common
{
@ -22,12 +21,9 @@ namespace BizHawk.Emulation.Common
[AttributeUsage(AttributeTargets.Class)]
public sealed class ServiceNotApplicableAttribute : Attribute
{
/// <remarks>TODO neither array nor <see cref="IEnumerable{T}"/> is the correct collection to be using here, try <see cref="IReadOnlyList{T}"/>/<see cref="IReadOnlyCollection{T}"/> instead</remarks>
public ServiceNotApplicableAttribute(Type[]? types)
{
NotApplicableTypes = types?.AsEnumerable() ?? Enumerable.Empty<Type>();
}
public IReadOnlyCollection<Type> NotApplicableTypes { get; }
public IEnumerable<Type> NotApplicableTypes { get; }
public ServiceNotApplicableAttribute(Type[] types)
=> NotApplicableTypes = types;
}
}