Version Used:
Visual Studio 16.11.3
Steps to Reproduce:
using Qux = Foo.Bar;
public class Foo
{
public enum Bar
{
Baz
}
public int Qux { get; set; }
// Okay, but suggests IDE0002: Simplify member access, see Method2.
public void Method1(Qux qux = Foo.Bar.Baz)
{
}
// CS1061: 'int' does not contain a definition for 'Baz' and no accessible extension method 'Baz' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?).
public void Method2(Qux qux = Qux.Baz)
{
}
}
Expected Behavior:
Either a valid code that generates no errors or no suggestion.
Actual Behavior:
Code that worked before applying rule suggestion generates CS1061 error after. Either way, compiler should not confuse optional argument default value with property access.
Version Used:
Visual Studio 16.11.3
Steps to Reproduce:
Expected Behavior:
Either a valid code that generates no errors or no suggestion.
Actual Behavior:
Code that worked before applying rule suggestion generates CS1061 error after. Either way, compiler should not confuse optional argument default value with property access.