tags:

views:

63

answers:

1

For instance, parameters in a method that use the "out" keyword in C# will show up in the metadata signature preceded by an ambersand "&". I'm trying to create the signature for a generic method but I don't want to use the metadata APIs to figure this out, surely it's documented somewhere?

Here's an example of what I mean for BeginReceiveFrom on the Socket class:

        System.IAsyncResult([]System.Byte,System.Int32,System.Int32,
    System.Net.Sockets.SocketFlags,&System.Net.EndPoint,
System.AsyncCallback,System.Object)
+3  A: 

There's a backtick followed by the number of arguments, for the unconstructed type, e.g.

List`1
Dictionary`2

From ECMA 335, section 10.7.2:

10.7.2 Type names and arity encoding

CLS-compliant generic type names are encoded using the format name['arity] , where […] indicates that the grave accent character "'" and arity together are optional. The encoded name shall follow these rules:

  1. name shall be an ID (see Partition II) that does not contain the “`” character.
  2. arity is specified as an unsigned decimal number without leading zeros or spaces.
  3. For a normal generic type, arity is the number of type parameters declared on the type.
  4. For a nested generic type, arity is the number of newly introduced type parameters.

(Note that I couldn't get the backtick to work in the quotes, due to markdown - hence the apostrophes!)

Not sure about constructed types...

Jon Skeet