Valid C# code flaged as error

The following code is flagged as an error with an "Unexpected Token", yet
compliles cleanly. I realize it's not good code, but if the compiler
accepts it, it shouldn't be flagged as an error (though I'd probably warn
due to the potential for null pointer exceptions).

multiFieldsRow["ParentColumns"] = multiFieldsRow["ParentColumns"] as string
+ "," + otherFieldsRows[0]["ParentColumns"] as string;



The error is flagged at the end of the 'as string' right before the +



Just FYI.






1 comment
Comment actions Permalink

Hi Paul,

I've submitted a request for this problem:
http://www.intellij.net/tracker/resharper/viewSCR?publicId=4576

"Paul Bradshaw" <pbradshaw@advsol.com> wrote in message
news:cge033$6mg$1@is.intellij.net...

The following code is flagged as an error with an "Unexpected Token", yet
compliles cleanly. I realize it's not good code, but if the compiler
accepts it, it shouldn't be flagged as an error (though I'd probably warn
due to the potential for null pointer exceptions).

>

multiFieldsRow["ParentColumns"] = multiFieldsRow["ParentColumns"] as
string
+ "," + otherFieldsRows[0]["ParentColumns"] as string;

>
>
>

The error is flagged at the end of the 'as string' right before the +

>
>
>

Just FYI.

>
>
>
>
>



0

Please sign in to leave a comment.