dotnet/roslyn

Bug with ref properties and IDE0052

Open

#72.884 aperta il 5 apr 2024

Vedi su GitHub
 (0 commenti) (1 reazione) (1 assegnatario)C# (4257 fork)batch import
Area-IDEBugFeature - IDE0052help 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.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

Guida contributor