dotnet/roslyn

Inline temporary variable with multiple assignments

Open

#34,753 opened on Apr 4, 2019

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C# (20,414 stars) (4,257 forks)batch import
Area-IDEBugIDE-CodeStylehelp wanted

Description

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);

Contributor guide