dotnet/roslyn

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

Open

#76.578 geöffnet am 29. Dez. 2024

Auf GitHub ansehen
 (0 Kommentare) (1 Reaktion) (0 zugewiesene Personen)C# (4.257 Forks)batch import
Area-IDEBugFeature - IDE0060help wanted

Repository-Metriken

Stars
 (20.414 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide