Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot rename generic type references #49

Closed
jgagnon opened this issue Dec 8, 2010 · 4 comments
Closed

Cannot rename generic type references #49

jgagnon opened this issue Dec 8, 2010 · 4 comments
Labels

Comments

@jgagnon
Copy link

jgagnon commented Dec 8, 2010

It is no longer possible to rename a generic type reference, due to the following commit :

6cc2e55

In AssemblyReader.cs, GetMemberReference method, the added condition prevents renames to generic type references to be saved :

  if (!member.ContainsGenericParameter)
    metadata.AddMemberReference (member);

If I comment out that if, it fixes the problem, but I presume it might break what you were trying to fix with that change.

@jbevain
Copy link
Owner

jbevain commented Dec 9, 2010

GetTypeReferences and GetMemberReferences should be considered read-only. You need to walk through the assembly to identify the references you want to update.

@jgagnon
Copy link
Author

jgagnon commented Dec 9, 2010

How do you walk through the assembly?

@jbevain
Copy link
Owner

jbevain commented Dec 9, 2010

For now, manually. You need to inspect the object tree, including the IL bodies, for every occurence of a reference you want to rename.

@jgagnon
Copy link
Author

jgagnon commented Dec 9, 2010

Ok, thanks for the information.

sbomer pushed a commit to sbomer/cecil that referenced this issue Dec 21, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants