I'm wondering why this is not working the way I expect it to work. Is this just the matter of "to ship is to choose" or is there a good practical reason, that the behaviour I'm expecting is problematic.
Consider this variable definition:
int[,] a
And this function signature
(int, int) FindIndex(int[,] a)
Given these I would expect this to work:
int index = a[FindIndex(a)];
But it does not, it gives:
CS0022 Wrong number of indices inside []; expected 2
I did not check the spec, but I'm sure that this is in accordance with spec, so I do not question if the implementation is correct, it surely is. What I would like to know, are there any practical reasons and/or considerations for this not to be supported?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…