locked
Regression in 1.5.60813.10: incorrect message when "Redundant Assumptions" is checked RRS feed

  • 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

  • This is still an issue in version 1.5.60911.10.
    Thursday, September 12, 2013 5:29 PM
  • Still an issue in 1.7.11202.10
    Wednesday, December 17, 2014 10:49 PM
  • Any update on this issue?

    Gregory OTT => http://twitter.com/gregory_ott
    ALM Engineer at Tekigo => www.tekigo.com

    Thursday, April 9, 2015 7:54 AM
  • Still an issue in Visual Studio 2015

    Alfred Myers http://alfredmyersjr.wordpress.com | http://twitter.com/AlfredMyers

    Friday, January 8, 2016 8:30 PM