fix: don't let generic user mapping override explicitly referenced mappings#2339
Merged
latonz merged 1 commit intoJun 22, 2026
Merged
Conversation
…ppings A generic user-implemented mapping method matched any source/target type pair during mapping resolution, which happens before the Use= named mapping reference is resolved. As a result a generic method (e.g. T Identity<T>(T)) shadowed mappings that were explicitly referenced via Use on individual members. Generic template matching is now skipped when a mapping is explicitly referenced by name, letting the UseNamedMappingBuilder resolve it. The named mapping builder also instantiates a concrete mapping when a generic method is referenced by name directly. Closes riok#2277
latonz
force-pushed
the
fix/2277-generic-user-mapping-overrides-use
branch
from
June 22, 2026 18:23
3cf8232 to
1027dd3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A generic user-implemented mapping method matched any source/target type pair during mapping resolution, which happens before the Use= named mapping reference is resolved. As a result a generic method (e.g. T Identity(T)) shadowed mappings that were explicitly referenced via Use on individual members.
Generic template matching is now skipped when a mapping is explicitly referenced by name, letting the UseNamedMappingBuilder resolve it. The named mapping builder also instantiates a concrete mapping when a generic method is referenced by name directly.
Closes #2277
Checklist