-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C#: Add support for custom assert methods (DoesNotReturnIfAttribute) #4484
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
C#: Add support for custom assert methods (DoesNotReturnIfAttribute) #4484
Conversation
585fd15 to
599f5bd
Compare
599f5bd to
52bdd8b
Compare
9182cf7 to
52bdd8b
Compare
|
|
||
| override Class getExceptionClass() { | ||
| // The user defines the thrown exception. | ||
| any() |
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 creates a large Cartesian product, so better to return the System.Exception base class.
| override predicate hasEntry(ControlFlowElement pred, ControlFlowElement succ, Completion c) { | ||
| exists(AssertMethod m | | ||
| pred = last(a.getExpr(), c) and | ||
| pred = last(a.getAnExpr(), c) and |
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.
The CFG splitting logic will not work for assertions with multiple assertion arguments; I will address in a follow-up PR.
There are some nice fixes in the results, for example, we're not reporting on the following that it can be null: https://github.com/dotnet/runtime/blob/45833cb6e43b481cdb1dabe2ce29fca48ee7bf6a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicObject.cs#L465 |
That's excellent! |


No description provided.