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

Fix S3877 FN: Support for arrow methods #3754

Closed
andrei-epure-sonarsource opened this issue Nov 16, 2020 · 2 comments · Fixed by #9403
Closed

Fix S3877 FN: Support for arrow methods #3754

andrei-epure-sonarsource opened this issue Nov 16, 2020 · 2 comments · Fixed by #9403
Assignees
Labels
Area: C# C# rules related issues. Type: False Negative Rule is NOT triggered when it should be.

Comments

@andrei-epure-sonarsource
Copy link
Contributor

S3877 ExceptionShouldNotBeThrownFromUnexpectedMethods

Should have support for arrow methods.

class ArrowMethods : IDisposable
{
    static ArrowMethods() => throw new Exception(); // FN, needs support for throw expressions
    public void Dispose() => throw new Exception(); // FN
}
@pavel-mikula-sonarsource pavel-mikula-sonarsource added Type: False Negative Rule is NOT triggered when it should be. and removed Type: Improvement labels May 29, 2024
@pavel-mikula-sonarsource pavel-mikula-sonarsource changed the title Rule S3877: support for arrow methods Fix S3877 FN: Support for arrow methods May 29, 2024
@pavel-mikula-sonarsource
Copy link
Contributor

High priority, because it's a very common case in modern C# and it's easy to fix

@pavel-mikula-sonarsource pavel-mikula-sonarsource added this to the 9.27 milestone Jun 5, 2024
@pavel-mikula-sonarsource
Copy link
Contributor

It was fixed in #4734 a long time ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Type: False Negative Rule is NOT triggered when it should be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants