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

SA1612 triggered by using reserved keywords as parameter names #2280

Closed
BennieCopeland opened this issue Jan 26, 2017 · 3 comments
Closed

SA1612 triggered by using reserved keywords as parameter names #2280

BennieCopeland opened this issue Jan 26, 2017 · 3 comments

Comments

@BennieCopeland
Copy link

The check SA1612: The parameter '{param name}' does not exist. is being triggered by parameters that use the prefixed keywords for parameters. I'm using the 1.1.0-beta001 version of the analyzer.

/// <summary>
/// SomeMethod summary
/// </summary>
/// <param name="event">Does something</param>
private void SomeMethod(string @event)
{
}
@bjornhellander
Copy link
Contributor

OK. Thanks for the report!
For now, you can suppress the diagnostic and we will have a look at why this is happening.

@sharwell sharwell added this to the 1.1.0 milestone Jan 26, 2017
@bjornhellander
Copy link
Contributor

I'm fixing this. And I will try to see if there are similar problems with other rules.

@bjornhellander
Copy link
Contributor

For the record, the problem was that the rule tried to get the parameter name through parameter.Identifier.Text, but that property contains the actual text written in the code, which in this case is "@event". On the other hand, parameter.Identifier.ValueText contains just "event", so I changed the code to use that property instead.

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