Fix #399 - Fix mapper interface generation for internal types - #1010
Open
andrerav wants to merge 1 commit into
Open
Fix #399 - Fix mapper interface generation for internal types#1010andrerav wants to merge 1 commit into
andrerav wants to merge 1 commit into
Conversation
andrerav
force-pushed
the
andrerav/399/interface-accessibility
branch
from
August 20, 2026 08:52
52bf8ae to
621ecb3
Compare
DocSvartz
approved these changes
Aug 20, 2026
Comment on lines
+60
to
+66
| { | ||
| if (Definitions == null) | ||
| return false; | ||
|
|
||
| return Definitions.IsInternal || | ||
| Definitions.Implements?.Any(it => !it.GetTypeInfo().IsVisible) == true; | ||
| } |
Contributor
There was a problem hiding this comment.
@andrerav Have you checked if this has a negative impact on the generation of Extension mappers?
I haven't figured out what's actually going on there yet.
Origin creation logic is absolutely correct for generating class-based mappers. There is no need for implementation or inheritance.
Contributor
There was a problem hiding this comment.
Maybe internal class with proper implementations should be generated even in case MapperAttribute.IsInternal hasn't been specified
I think this statement contradicts the logic of C# itself.
Implemention an internal interface doesn't force a class to be internal, since implementation is not inheritance 😅
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.
Fixes mapper generation for interfaces that use internal source or destination types. The generated mapper class now uses the same effective visibility rule for both the class modifier and generated mapper members. If the generated class must be internal, its implicit interface implementation members can still be emitted as public.
Fixes #399.