Some trouble with SA1122

Apr 25, 2012 at 2:20 PM

Hi folks,

first of all: you are doing a great job and I love StyleCop - but unfortunately I've found a bug:

Let's say we have a method with an optional parameter like this:

public void SomeMethod(string firstParameter, string secondParameter = "")
{
    // Do something really cool
}

I'm using StyleCop within ReSharper and when I do "CleanCode" (having rule SA1122 active) the code is changed to

public void SomeMethod(string firstParameter, string secondParameter = string.Empty)
{
    // Do something really cool
}

which definitely leads to a compiler error. :-(

Coordinator
Apr 25, 2012 at 2:27 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.