Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the open generic type of the array []?

When I do int[], string[], T[] - this is a generic array. An array is just an object like everything else.

So what is the actual open generic type of []? I assume it is just some syntactic sugar over something like Array<> but I haven't been able to find anything of the sort.

Bonus points if you can somehow answer this before Jon Skeet.

like image 742
George Mauer Avatar asked Dec 05 '22 23:12

George Mauer


1 Answers

It's just System.Array; it isn't generic. See here for a brief discussion: http://blogs.msdn.com/b/ericlippert/archive/2007/10/17/covariance-and-contravariance-in-c-part-two-array-covariance.aspx

like image 96
Mark Sowul Avatar answered Dec 24 '22 10:12

Mark Sowul