none
Regression in 1.5.60813.10: incorrect message when "Redundant Assumptions" is checked

    Question

  • namespace RegressionDemo
    {
        public abstract class Foo
        {
            protected void Bar(object baz)
            {
                /* When "Redundant Assumptions" is checked, the next statement will incorrectly trigger the message:
                 * CodeContracts: Suggested requires: This precondition is redundant: Consider removing it. */
     
                if (baz == null)
                {
                    throw new System.ArgumentNullException("baz");
                }
     
                System.Diagnostics.Contracts.Contract.EndContractBlock();
            }
        }
    }


    Thursday, August 15, 2013 8:44 PM

All replies