-
Notifications
You must be signed in to change notification settings - Fork 130
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
[Feature]: Custom ReferenceImporter in MemberCloner #283
[Feature]: Custom ReferenceImporter in MemberCloner #283
Conversation
@Washi1337 thoughts? |
Yes, this might be the only way that I can see for now that will ensure proper references will be used, while also allowing consumers to customize the behavior of the importer. Side note: It may be best to not change existing constructors by adding optional parameters, but rather add constructor overloads instead. Adding optional parameters to a method / constructor is a breaking change on ABI level, forcing consumers to recompile their projects that use this feature. Introducing breaking changes I think should only happen if we want to bump up a major version (as per semver conventions). I made this mistake once with the introduction of |
Fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay in response. I have added a few minor questions / comments.
src/AsmResolver.DotNet/Cloning/CloneContextAwareReferenceImporter.cs
Outdated
Show resolved
Hide resolved
b8002f5
to
b5ac446
Compare
Should be good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks.
A draft pull request for addressing #93
One of the major design decisions I made was to require that any custom importers inherit from
CloneContextAwareReferenceImporter
instead ofReferenceImporter
or a hypotheticalIReferenceImporter
interface. I felt that this was the cleanest way to maintain correct references between cloned members.