C# used to have postconditions and verify them at compile time.
But this has been deprecated :(
I wish I knew why they removed it.
https://learn.microsoft.com/en-us/dotnet/framework/debug-tra...
https://learn.microsoft.com/en-us/dotnet/framework/debug-tra...