locked
Warning targets wrong line in source file RRS feed

  • Question

  •         public static void Test(string str1, string str2)
            {
                Contract.Requires(str1 != null, "str1");
                Contract.Requires(str2 != null, "str2"); // CodeContracts: requires unproven: startIndex <= this.Length
    
                try
                {
                    Guid id = new Guid(str1.Substring(str2.Length) ?? string.Empty); // Previous warning should point this line
                }
    
                catch
                {
                }
            }
    
    

    Sunday, February 14, 2010 1:12 PM

Answers

  • Hey thanks for reporting this. I tracked down the issue and we should be getting better source contexts in the next release.

     


    Cheers, -MaF (Manuel Fahndrich)
    Monday, April 12, 2010 10:19 PM