I have an application that runs through the rounds in a tournament, and I am getting a contract warning on this simplified code structure:
public static void LoadState(IList<Object> stuff)
{
for(int i = 0; i < stuff.Count; i++)
{
// Contract.Assert(i < stuff.Count);
// Contract.Assume(i < stuff.Count);
Object thing = stuff[i];
Console.WriteLine(thing.ToString());
}
}
The warning is:
contracts: requires unproven: index < @this.Count
What am I doing wrong? How can I prove this on an IList<T>
? Is this a bug in the static analyzer? How would I submit a bug report to Microsoft?