Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit 400467b

Browse files
committed
Fix wrong contract due to wrong method documentation
1 parent 0f7910e commit 400467b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Microsoft.Research/Contracts/MsCorlib/System.Collections.ObjectModel.Collection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ protected virtual void RemoveItem(int index)
383383
// index is less than zero.-or-index is greater than System.Collections.ObjectModel.Collection<T>.Count.
384384
protected virtual void SetItem(int index, T item)
385385
{
386-
Contract.Requires((index >= 0) && (index <= Count));
386+
// Comment is wrong, index must be < Count!
387+
Contract.Requires((index >= 0) && (index < Count));
387388
}
388389

389390
IEnumerator IEnumerable.GetEnumerator()

0 commit comments

Comments
 (0)