Given the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;
using System;
public class Program
{
public int[] ints = new int[1000];
[ContractInvariantMethod]
private void ObjectInvariant ()
{
Contract.Invariant(ints.GetType() == typeof(int[]));
Contract.Invariant(ints != null);
}
}
Why is the invariant ints.GetType() == typeof(int[])
considered to cannot be proven? If I change the invariant to ints.GetType() == ints.GetType()
it passes (without any surpise), but why does it fail for typeof(int[])
.