Jagged array creation with wrong size specified does not show as error.

This code should show as an error but does not:

var array1 = new object?[][3];

This code is ok:

var array2 = new object?[3][];

This code should show an error and does:

var array3 = new object?[][];
0
3 comments

Hello Dave,

Thanks for your comment. Unfortunately, it looks like you have faced a known issue: 

RSRP-477302 Rider does not highlight error in invalid initialization for multidimension array. 

We are still reviewing the feature request, and Rider will show the CS1586 error when ReSharper backend realized the corresponding static analyze feature.

We would appreciate it if you would upvote it in order to bring increased awareness to the issue. One can also click Watch to monitor the status. Thanks for your understanding!

Regards,

Tao

 

0

ok thanks, wow known issue for 4 years, ok.

0

Dave Cousineau  Sorry for the inconvenience bring to you.

It would be nice if you could vote the YouTrack issue, and we will update the status of problem fixes on it.

0

Please sign in to leave a comment.