dotnet/roslyn

Bug with ref properties and IDE0052

Open

#72,884 创建于 2024年4月5日

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

仓库指标

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

描述

Version Used: VS 17.9.0 on .NET 8.0

Steps to Reproduce:

class C1
{
	int a;
	private ref int A => ref a;
	public void Increment() => A++;
}

Diagnostic Id: IDE0052

Expected Behavior:

No diagnostic, since it's read, incremented, then written.

Actual Behavior:

There is a diagnostic claiming it's never been read.

Related:

Potentially https://github.com/dotnet/roslyn/issues/25057

贡献者指南