dotnet/roslyn

Inline temporary variable with multiple assignments

Open

#34,753 建立於 2019年4月4日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)C# (20,414 star) (4,257 fork)batch import
Area-IDEBugIDE-CodeStylehelp wanted

描述

Version Used: Visual Studio 2019 version 16.0

Steps to Reproduce:

var x = 3;
x = x + 2;
Console.WriteLine(x);

Apply Inline temporary variable on the definition of x.

Expected Behavior:

var x = 3 + 2;
Console.WriteLine(x);

Actual Behavior:

var x = 3;
x = 3 + 2;
Console.WriteLine(3);

貢獻者指南

Inline temporary variable with multiple assignments · dotnet/roslyn#34753 | Good First Issue