Skip to content

The type parameter name of unbound generic type has not consistent naming conventions #741

Answered by jbevain
hiihellox10 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

The difference you're seeing between the Dictionary<> and your MockDictionary<> is that Dictionary<> is defined in another module (and thus is represented as a TypeReference), while MockDictionary<> is defined in the current module (and thus is represented as a TypeDefinition.

In the metadata, the name of the generic parameters are not referenced between modules, only their position.

So if you want to be consistent, you need to resolve the TypeReference into a TypeDefinition from its module to look at its generic parameters to get the original generic parameter name.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hiihellox10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #740 on March 24, 2021 16:44.