-
Notifications
You must be signed in to change notification settings - Fork 227
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
Rule S3717: Track use of 'NotImplementedException' #603
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice simple code and so many catches!
|
||
var typeInfo = c.SemanticModel.GetTypeInfo(throwStatement.Expression); | ||
|
||
if (typeInfo.Type == null || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if with return can be ommited - Type.Is already covers these cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad!
@@ -0,0 +1,13 @@ | |||
using System; | |||
|
|||
namespace Tests.Diagnostics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add more test cases:
- Create a type inheriting from NotImplementedException. Should we report on that?
- Create an exception, but do not throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add the tests. I don't think we should handle sub-classes of NotImplementedException
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with that (as long as you add tests).
Should we mention that exception in RSPEC text?
Fix #585