I probably miss something with array construction syntax in c#. If I have the following function (thanks to type variance feature in c# 4):
IEnumerable<IEnumerable<T>> test<T>()
{
return new List<List<T>>();
}
How can I write similar one that instantiates array of array?
I noticed that there used to be a bug in the mono compiler (at least, the 2.6.7 gmcs would crash…) that required you to spell
new IEnumerable<T>[] { new T[] {}}; This is no longer a problem with e.g. mono 2.11Alternatively
you could use a yield block (which would be less efficient)
Enumerable.Empty<>Are you aware of
Enumerable.Empty<>?