- .NET SDK Version: Any
- GuardClauses Version: 3.2.0
Steps to Reproduce:
- Using the current 3.2.0 Nuget Release in a console application
- Add this sample code:
private static void TestStruct(int x)
{
Guard.Against.OutOfRange(x, nameof(x), -10, 10); // OK
Guard.Against.OutOfRange<int>(x, nameof(x), -10, 10); // Compiler Error: CS1501 No overload for method 'OutOfRange' takes 4 arguments.
}
See this dotnetfiddle https://dotnetfiddle.net/nbXa8U
Recommendation:
- Rename the 2
OutOfRange clauses for Enums to EnumOutOfRange. To avoid any conflict. And making the naming more mean full when we are dealing with the Enum clauses.