views:

75

answers:

2

I'm looking at the MSDN docs about List.GetEnumerator.

They say the C# method signature is:

public List<(Of <(<'T>)>)>..::..Enumerator GetEnumerator()

I was expecting this much simpler signature:

public List<T>.Enumerator GetEnumerator()

What does their signature mean, with all the punctuation and the "Of" keyword?

Edit: Well, I guess if no one has seen that syntax, then the MSDN docs are just a bit buggy, and that's all.

+1  A: 

MSDN uses some code generation to supply that signature for all of the different languages, and this looks like a bug in that code which forgets to take the actual language into account and just outputs all of the syntax - everythign in there can be matched to the expected syntax for such a return type in some language (although, admittedly, I'm not entirely sure where the apostrophe is from).

The same problem can be seen on other pages, such as the very similar HashSet.GetEnumerator, but not on others, like Queryable.AsQueryable, so it seems likely that they don't generate everything at once, and the bug was introduced/removed between the generation of those two pages. (Since we don't know how new each of those are, we can't guess if it's already been fixed.)

I don't know if they have automatic re-generation running every now and then, but if they do, it will probably fix itself soon. If not, you could leave a comment about it in the Community Content section.

Michael Madsen
A: 

Looks like a mistake in MSDN. Take a look at how Queue is defined: http://msdn.microsoft.com/en-us/library/7977ey2c(v=VS.90).aspx

Vivek