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

SA1000 ("'new' keyword should be followed by space") shouldn't be thrown for target-typed new(). #3391

Closed
ssg opened this issue Oct 10, 2021 · 3 comments

Comments

@ssg
Copy link
Contributor

ssg commented Oct 10, 2021

StyleCop.Analyzers 1.1.118.

csproj targets netstandard2.1 but with <Language>latest</Language>. Not sure if it's related to this problem.

SA1000 wants to add a space after target-typed new statements making them look like new (). All official examples show the new target-typed new syntax as new() without a space. SA1000 shouldn't suggest the space for target-typed new statements.

@ssg ssg changed the title SA1000 ("'new' keyword should be followed by space") shouldn't be thrown for typeless new. SA1000 ("'new' keyword should be followed by space") shouldn't be thrown for target-typed new. Oct 10, 2021
@ssg ssg changed the title SA1000 ("'new' keyword should be followed by space") shouldn't be thrown for target-typed new. SA1000 ("'new' keyword should be followed by space") shouldn't be thrown for target-typed new(). Oct 10, 2021
@sharwell
Copy link
Member

Duplicate of #3214

@sharwell sharwell marked this as a duplicate of #3214 Oct 11, 2021
@lachezar-gizdov
Copy link

I'm on the latest beta version, and this still appears as a warning?

@sharwell sharwell closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2023
@sharwell
Copy link
Member

sharwell commented Sep 27, 2023

@lachezar-gizdov it seems likely that one way or another, an older version is still running. Probably best to file a new issue with a sample solution to reproduce the issue.

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

3 participants