Version Used:
Not sure what version is meant but I'm using Visual Studio 15.7.1, I hope that helps.
Steps to Reproduce:
Config:
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
Code:
enum A { B, C };
public void Fun()
{
A A = A.B;
}
Expected Behavior:
No IDE0007 and no suggested "code fix".
Actual Behavior:
It suggests to replace A with var but that would lead to code that won't compile (Cannot use local variable before it's declared).
After code fix:
enum A { B, C };
public void Fun()
{
var A = A.B;
}
Version Used:
Not sure what version is meant but I'm using Visual Studio 15.7.1, I hope that helps.
Steps to Reproduce:
Config:
Code:
Expected Behavior:
No IDE0007 and no suggested "code fix".
Actual Behavior:
It suggests to replace
Awithvarbut that would lead to code that won't compile (Cannot use local variable before it's declared).After code fix: