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 False Positive for C# 9 target-typed new #3414

Closed
pavel-mikula-sonarsource opened this issue Dec 7, 2021 · 2 comments
Closed

SA1000 False Positive for C# 9 target-typed new #3414

pavel-mikula-sonarsource opened this issue Dec 7, 2021 · 2 comments

Comments

@pavel-mikula-sonarsource
Copy link
Contributor

pavel-mikula-sonarsource commented Dec 7, 2021

Rule SA1000 should not fire for C# 9 target-typed new keyword followed by an open brace:

public object NewObject() => new();
public System.Exception NewException(string message) => new(message);

Visual Studio default formatting doesn't put a space there.

@pavel-mikula-sonarsource
Copy link
Contributor Author

@sharwell can you please check that this makes sense? If so, I can give it a try to create a PR to fix it.

@sharwell
Copy link
Member

sharwell commented Dec 7, 2021

Duplicate of #3214

@sharwell sharwell marked this as a duplicate of #3214 Dec 7, 2021
@sharwell sharwell closed this as completed Dec 7, 2021
@sharwell sharwell closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2023
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

2 participants