Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SA1114 (Parameter list must follow declaration): Should ignore #pragma directives #830

Closed
oatkins opened this issue May 11, 2015 · 1 comment
Assignees
Milestone

Comments

@oatkins
Copy link
Contributor

oatkins commented May 11, 2015

The following code is not reported by legacy SC, but fails the new version of SA1114:

using System;

public class SomeOtherClass
{
    private void SomeMethod()
    {
        this.SomeOtherMethod(
#pragma warning disable 618
                this.SomeObsoleteMethod());
#pragma warning restore 618
    }

    [Obsolete("Don't use me!")]
    private int SomeObsoleteMethod()
    {
        return 0;
    }

    private void SomeOtherMethod(int someParameter)
    {
    }
}

Lines that contain #pragma directives should generally be ignored by SC rules.

Warning 618 relates to the use of a member marked obsolete. The #pragma line can be moved to resolve the warning. However, it would be better not to have to move it. (Doing so might unintentionally suppress other errors.)

@macpak
Copy link
Contributor

macpak commented May 12, 2015

Ok, I will look at it.

@sharwell sharwell added the bug label May 12, 2015
Noryoko added a commit to Noryoko/StyleCopAnalyzers that referenced this issue Aug 8, 2015
@sharwell sharwell added the fixed label Aug 8, 2015
@sharwell sharwell added this to the 1.0.0 Beta 5 milestone Aug 8, 2015
@sharwell sharwell assigned Noryoko and unassigned macpak Aug 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants