Open
Description
openedon Nov 14, 2022
Analyzer
Diagnostic ID: RS0026: Do not add multiple overloads with optional parameters
Analyzer source
NuGet Package: Microsoft.CodeAnalysis.PublicApiAnalyzers
Version: 3.3.3 (Latest)
Describe the bug
The documentation for this error suggests that the issue is multiple overloads where the differentiating parameters are optional. However, this will fire for multiple overloads that are always differentiable just because both have optional parameters.
Steps To Reproduce
public class MyClass
{
public MyClass(string name, string connectionString, Action<object> options = null, bool exactName = false) { }
public MyClass(string name, IDbConnection connection, bool exactName = false) { }
}
Expected behavior
No error, or documentation that explains why this is a compat problem.
Actual behavior
RS0026
Additional context
Adding the analyzer to an existing project to track its API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment