dotnet/roslyn

Inline temporary variable with multiple assignments

Aperta

#34.753 aperta il 4 apr 2019

 (3 commenti) (0 reazioni) (0 assegnatari)C# (4257 fork)batch import
Area-IDEBugIDE-CodeStylehelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

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

Guida contributor