dotnet/roslyn

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

Open

#76,578 创建于 2024年12月29日

在 GitHub 查看
 (0 评论) (1 反应) (0 负责人)C# (4,257 fork)batch import
Area-IDEBugFeature - IDE0060help wanted

仓库指标

Star
 (20,414 star)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 256 个 PR)

描述

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

贡献者指南