dotnet/roslyn

IDE0060 (Remove unused parameter) false positive for interpolated string handler argument

Open

#76.578 aperta il 29 dic 2024

Vedi su GitHub
 (0 commenti) (1 reazione) (0 assegnatari)C# (4257 fork)batch import
Area-IDEBugFeature - IDE0060help wanted

Metriche repository

Star
 (20.414 star)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

Version Used:

VS 17.13 Preview 1

Steps to Reproduce:

public static void M(bool x, [InterpolatedStringHandlerArgument(nameof(x))] ref MyInterpolatedStringHandler y)
{
    // Do something with message. Analyzer will complain that `x` parameter isn't used. But it's actually used as the value will be passed to `MyInterpolatedStringHandler`
}

Diagnostic Id: IDE0060 (Remove unused parameter)

Expected Behavior:

No diagnostic

Actual Behavior:

False positive diagnostic

Guida contributor