dotnet/roslyn

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

Open

#76 578 ouverte le 29 déc. 2024

Voir sur GitHub
 (0 commentaires) (1 réaction) (0 assignés)C# (4 257 forks)batch import
Area-IDEBugFeature - IDE0060help wanted

Métriques du dépôt

Stars
 (20 414 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (256 PRs mergées en 30 j)

Description

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

Guide contributeur