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

SA1649 does not recognize RecordDeclaration for record types introduced in C# 9 #3213

Closed
coder2000 opened this issue Oct 1, 2020 · 12 comments · Fixed by #3215
Closed

SA1649 does not recognize RecordDeclaration for record types introduced in C# 9 #3213

coder2000 opened this issue Oct 1, 2020 · 12 comments · Fixed by #3215
Assignees

Comments

@coder2000
Copy link

C# 9 introduced a new record type and the file naming SA1649 does not recognize it yet.

@sharwell sharwell added the c# 9 label Oct 1, 2020
@sharwell
Copy link
Member

sharwell commented Oct 1, 2020

📝 The analysis here should treat the record as a class

@coder2000
Copy link
Author

I looked into adding it myself but wasn't familiar with how I should do it given that it is not backwards compatible with .NET 4.5.2 or .NET Standard 1.1

@IngvarKofoed
Copy link

Yes, its seem that the target new needs to be at least netstandard2.0. Should the whole solution jump to netstandard2.0?

@sharwell
Copy link
Member

sharwell commented Oct 2, 2020

Pull request #3209 shows some examples for how to handle record declarations. It shouldn't be necessary to update the project references.

@Trolldemorted
Copy link

I am experiencing this bug with the latest stable StyleCop.Analyzers from nuget. Can you estimate when you will release a fix?

My tfm is <TargetFramework>net5.0</TargetFramework> if that matters.

@sharwell
Copy link
Member

@Trolldemorted the fix is available in 1.2.0-beta.161 and newer.

@Trolldemorted
Copy link

Thanks for the quick reponse! Will you release a stable version with that fix in the near future?

@sharwell
Copy link
Member

There are no current plans to do so in the near future.

@jpactor
Copy link

jpactor commented May 23, 2022

There are no current plans to do so in the near future.

How about now, since we're already on C# 10?

@sharwell
Copy link
Member

sharwell commented May 24, 2022

Given current resources and the rate of language version updates, it's questionable whether we will be able to complete a feature audit and stabilization pass for another non-beta release. Since NuGet does not have any requirement for development dependencies to have non-pre-release versions, this is not a high priority item.

@GaTechThomas
Copy link

Any chance we can get this change made as a patch to the released version? Having using packages tagged as beta in production systems raises audit flags.

@sharwell
Copy link
Member

Having using packages tagged as beta in production systems raises audit flags.

@GaTechThomas We publish a second package without the beta tag to support audit pipelines that fail to account for NuGet's explicit allowance of beta packages that do not contain any shipping content.
https://www.nuget.org/packages/StyleCop.Analyzers.Unstable

jagilber added a commit to jagilber/service-fabric-yarp that referenced this issue Jan 28, 2024
…Analyzers.DocumentationRules.SA1649FileNameMustMatchTypeName' threw an exception of type 'System.ArgumentException' with message 'Unhandled declaration kind: RecordDe

claration'. re: DotNetAnalyzers/StyleCopAnalyzers#3213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants