roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

RCS1031 conflicts with RCS1111

Open victoriazakharo opened this issue 5 years ago • 2 comments
trafficstars

Product and Version Used: Roslynator 2.3.0 Visual Studio 2017, 15.9.19 Steps to Reproduce: Consider a trivial switch-case where sections have multiple statements:

        public void TestSwitch(int param)
        {
            switch (param)
            {
                case 1:
                    Console.WriteLine("a");
                    break;
                case 2:
                    {
                        Console.WriteLine("b");
                        break;
                    }
            }
        }

Also consider that both RCS1031 and RCS1111 are included into the ruleset. Case 1 will cause RCS1111 requiring to add the braces, but case 2 will cause RCS1031 requiring to remove the braces. Actual Behavior: RCS1031 confilcts with RCS1111 Expected Behavior: RCS1031 and RCS1111 have same opinion about the necessity of braces in this case.

victoriazakharo avatar Feb 27 '20 09:02 victoriazakharo

Just hit this issue with version 4.1.1

xt0rted avatar Oct 16 '22 01:10 xt0rted

I think that these diagnostic rules cannot be used both at the same time.

josefpihrt avatar Nov 20 '22 21:11 josefpihrt