cecil icon indicating copy to clipboard operation
cecil copied to clipboard

Changing TypeDefinition name does not update name_cache

Open sajagi opened this issue 5 years ago • 1 comments

TypeDefinitionColleciton.name_cache keeps old namespace and name key. This causes errors when trying to export another assembly where TypeReferences were appriopriately renamed as well - resolving TypeReference to TypeDefinition fails.

Example:

// LibA.dll
public enum Foo { A }

// LibB.dll (references LibA)
public void Bar(Foo x = Foo.A) { } 

sajagi avatar Nov 07 '19 13:11 sajagi

Eurk, good catch. Thanks for filing this.

jbevain avatar Nov 07 '19 16:11 jbevain