You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
Rewriting this code with level < 4 (i.e. not in a Full mode) should remove Assert method call from the iterator block.
But in reality, ccrewriter removes anly method call itself, but leaves precondition check in the final IL code.
Running this code with Preconditions only, will print "Check" message on the screen.
The same behavior would be for async methods as well.
UPDATE: minor correction.
To reproduce this issue complexity of the expression matters but not where it was called (iterator block/async method/regular method):
privatestaticvoidFoo(stringstr){// Check method would be called
Contract.Assert(Check()&&str!=null);
Console.WriteLine("Boo");}privatestaticvoidFoo2(stringstr){// Call to Check method would be erased
Contract.Assert(Check());
Console.WriteLine("Boo");}
With Preconditions only in Foo method Checkmethod would be called but inFoo2` method - not.
The text was updated successfully, but these errors were encountered:
I assume (pun intended) that this bug is related to #34.
Consider following code:
Rewriting this code with level < 4 (i.e. not in a Full mode) should remove
Assert
method call from the iterator block.But in reality, ccrewriter removes anly method call itself, but leaves precondition check in the final IL code.
Running this code with Preconditions only, will print "Check" message on the screen.
The same behavior would be for async methods as well.
UPDATE: minor correction.
To reproduce this issue complexity of the expression matters but not where it was called (iterator block/async method/regular method):
With Preconditions only in
Foo
method Checkmethod would be called but in
Foo2` method - not.The text was updated successfully, but these errors were encountered: