vendredi 22 septembre 2023

Name of array of multidimensional arrays?

The name of an array of multidimensional arrays (or a multidimensional array of arrays) in .NET Reflection is in "reverse" order to what you would expect.

For example:

typeof(int[][,]).Name == "Int32[,][]" // "intuitively" it should be "Int32[][,]"
typeof(int[][,,][,]).Name == "Int32[,][,,][]" // seems it should be "Int32[][,,][,]" instead
typeof(int[][,,][]).Name == "Int32[][,,][]" // this is as I expected, but only because it's symmetrical

What is the reason for this?





Aucun commentaire:

Enregistrer un commentaire