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

String.IndexOfAny contract incorrect #200

Closed
codespare opened this issue Aug 10, 2015 · 2 comments
Closed

String.IndexOfAny contract incorrect #200

codespare opened this issue Aug 10, 2015 · 2 comments

Comments

@codespare
Copy link

Both the .NET 4.5 mscorlib contract reference assembly and \bin\Devlab9ro.NETFramework\v4.5\mscorlib.Contracts.dll for int String.IndexOfAny(char[] anyOf, int startIndex, int count)
still contain: System.Diagnostics.Contracts.Contract.Requires(startIndex + count < this.Length, null, "startIndex + count < Length"); which should be: System.Diagnostics.Contracts.Contract.Requires(startIndex + count <= this.Length, null, "startIndex + count <= Length"); as it is in int String.IndexOf(string value, int startIndex, int count) for instance.

@fedotovalex
Copy link
Contributor

This is easy to fix, thanks for reporting it.

@codespare
Copy link
Author

Great, thanks! It made for puzzling unit tests :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants