زه کوډ لرم چې ورته ورته ښکاري:
public class Foo<T> : ObservableCollection<T>
{
private T bar;
public Foo(IEnumerable<T> items)
: base(items.ToList())
{
Contract.Requires(items != null);
if (this.Any())
this.bar = this[0]; // gives 'requires unproven: index < @this.Count'
}
}
باید هیڅ
لپاره د چک حساب شاخص 0؟ ایا زه یو غلط کار کوم ، یا ایا کوډکونټیکټس یوازې دا قضیه نه پیژني؟