Sergey Teplyakov
Sergey Teplyakov
Additional action could be: to add precondition to the base class's method.
Contract validation method marked with `ContractArgumentValidator` should follow few rules: 1. Guard method should has a if-throw 2. if-throw should follow `Contract.EndContractBlock` So following code will emit the warning: ```...
Following code will lead to an error from the Code Contract Compiler: ``` csharp private static string _foo; public void AssignmentInContractBlock() { // error CC1038: Member 'CodeContractInvestigations.MalformedContractErrors._foo' has less visibility...
Warn for inconsistency between object invariant and postconditions. For example, warning should be issued: ``` csharp class Foo { private void ObjectInvariant() { Contract.Invariant(Property != null); } [CanBeNull] public string...
Following code issues an error from Code Contract compiler: ``` csharp class InstanceValidator { private readonly bool _condition; public InstanceValidator(bool condition) { _condition = condition; } [ContractArgumentValidator] public void Guard()...
1. Add support for new `InterpolatedStringHandlers`. The C# 10 interpolated string improvements allow having no-allocation API. 2. Add code fixes to move from `Contract.Check(predicate)?.Assert` to normal `Assert`. 3. Update bxl...
This should be flagged as suspicious code: ```csharp public struct MyDisposable : IDisposable { public void Dispose() { } } internal class Program { static Task FooBar() { return Task.FromResult(0);...
For instance, if the application uses C# 7.2, do not emit a warning that a method can be made readonly, because the fix will produce a non-compilable code. Consider emitting...