Another code analysis bug in 4.0.738.4

In the following method Resharper (4.0.738.4) underlines the characters parameter and says "Parameter can be of type ICollection". This is wrong, ".Length" is declared in the Array class. Its not available on ICollection]]>. Although ".Count" could be used instead, but its still a bug :)

*private static void Test(char[] characters)
{
Console.Write(characters.Length);
}*

1 comment
Comment actions Permalink

Hello Tomas,

As far as I remember, analysis specifically handles this case and allows
such suggestion. It is Quick Fix that should update Length to Count, but
fails.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> In the following method Resharper (4.0.738.4) underlines the
IR> characters parameter and says "Parameter can be of type
IR> ICollection". IR> IR> This is wrong, ".Length" is declared in the Array class. Its not IR> available on ICollection. Although ".Count" could be used IR>]]> instead, but its still a bug :)
IR>
IR> *private static void Test(char[] characters)
IR> {
IR> Console.Write(characters.Length);
IR> }*


0

Please sign in to leave a comment.