Bug in error highlightning?

I've just starting using ReSharper, so this might already been fixed.

If I enter this code (from MSDN) in the editor:

unsafe
{
String utfeightstring = null;
sbyte [] asciiChars = new sbyte[] { 0x51,0x52,0x53,0x54,0x54,0x56 };
UTF8Encoding encoding = new UTF8Encoding(true, true);

fixed(sbyte* pAsciiChars = asciiChars)
{
utfeightstring = new
String(pAsciiChars,0,asciiChars.Length,encoding);
}
Console.WriteLine("The UTF8 String is " + utfeightstring );
}


pAsciiChars in the string constructor gets marked as an error (Argument
type 'sbyte' is not assignable to parameter type 'SByte'). But the
code compiles and runs fine.

Is this a bug, or is it just me (I'm totally new to C# and .NET).

/Anders

1 comment
Comment actions Permalink

Anders,

this is a bug in ReSharper. 'sbyte' and 'SByte' are of course just synonims
for the same type System.SByte.
This bug is tracked under the following URL:
http://www.intellij.net/tracker/resharper/viewSCR?publicId=1189

"Anders Magnusson" <d98_ama@hotmail.com> wrote in message
news:c5vqtd$m4o$1@is.intellij.net...

I've just starting using ReSharper, so this might already been fixed.

>

If I enter this code (from MSDN) in the editor:

>

unsafe
{
String utfeightstring = null;
sbyte [] asciiChars = new sbyte[] { 0x51,0x52,0x53,0x54,0x54,0x56 };
UTF8Encoding encoding = new UTF8Encoding(true, true);

>

fixed(sbyte* pAsciiChars = asciiChars)
{
utfeightstring = new
String(pAsciiChars,0,asciiChars.Length,encoding);
}
Console.WriteLine("The UTF8 String is " + utfeightstring );
}

>
>

pAsciiChars in the string constructor gets marked as an error (Argument
type 'sbyte' is not assignable to parameter type 'SByte'). But the
code compiles and runs fine.

>

Is this a bug, or is it just me (I'm totally new to C# and .NET).

>

/Anders



0

Please sign in to leave a comment.