u2uconsult/codeanalyzers

U2U1206 when using overload with index

Closed this issue · 2 comments

This snippet triggers U2U1206 telling me to use an overload of Any with the same predicate instead

Enumerable.Empty<int>()
	.Where((source, index) => true)
	.Any();

In System.Linq there is no overload of Any that takes a index parameter.

Am I missing something, or is this a false positive?

This is a false positive indeed.

Thanks for reporting the bug, it will be fixed in the next release later this week.

A fix is now available for download, in version 2.13.2.