We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
S112 isn't raised when throw new Exception(); is used with null-coalesce operator
throw new Exception();
var test = "" ?? throw new Exception(); // Doesn't raise S112 throw new Exception(); // Raises S112
S112 is raised on both lines
S112 is raised only on the second line
Not using null-coalesce operator
The text was updated successfully, but these errors were encountered:
Hi @nalka0,
Thank you for reporting this case, I confirm it as FN.
Sorry, something went wrong.
S112: Add FN repro for #7910
915049f
Other scenarios: Lambda
_ => throw new Exception()
and arrow methods
public void Go() => throw new Exception();
pavel-mikula-sonarsource
Successfully merging a pull request may close this issue.
Description
S112 isn't raised when
throw new Exception();
is used with null-coalesce operatorRepro steps
Expected behavior
S112 is raised on both lines
Actual behavior
S112 is raised only on the second line
Known workarounds
Not using null-coalesce operator
Related information
The text was updated successfully, but these errors were encountered: