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

SA1642: Validation incorrect for classes with generic parametes #2967

Open
gps7 opened this issue Jun 12, 2019 · 3 comments
Open

SA1642: Validation incorrect for classes with generic parametes #2967

gps7 opened this issue Jun 12, 2019 · 3 comments

Comments

@gps7
Copy link

gps7 commented Jun 12, 2019

Hi,
This case seems to be very similar to Case #415, but relates to dynamic parameters. For example StyleCop classic still finds this violation but not the analyzer. The violation of wrong type name XXX not picked up:

	public class AuthorizationPolicy<TIDENT>
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="AuthorizationPolicy{XXX}"/> class.
		/// </summary>
		public AuthorizationPolicy()
		{
			Id = Guid.NewGuid().ToString();
		}
@sharwell
Copy link
Member

According to the C# compiler, there is no difference between AuthorizationPolicy{TIDENT}, AuthorizationPolicy{T}, and AuthorizationPolicy{XXX}. All of them reference the same generic type AuthorizationPolicy<TIDENT>.

@gps7
Copy link
Author

gps7 commented Jun 13, 2019

Right, the compiler will not tell, since this is a documentation mismatch with declared name. Like I said Classic StyleCop picks up this as violation.

@sharwell
Copy link
Member

sharwell commented Jun 14, 2019

I think this would make the most sense as a new rule, as opposed to updating existing rules to start checking this. FWIW I would be in favor of the rule. Even if it's not accepted for StyleCop Analyzers, I would accept it for DocumentationAnalyzers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants