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

[BUG] private mappers are visible in other mappers #100

Open
stefankoppier opened this issue Sep 23, 2024 · 0 comments
Open

[BUG] private mappers are visible in other mappers #100

stefankoppier opened this issue Sep 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@stefankoppier
Copy link
Collaborator

stefankoppier commented Sep 23, 2024

Describe the bug
Nested non-visble (e.g. private) mappers from other objects should not be reused.

To Reproduce
Two mappers

object FirstMapper : ObjectMappie<Input, Output>() {
    override fun map(from: Input) {
       to::inner fromProperty from::inner
    }

    private object InnerInputMapper : ObjectMappie<InnerInput, InnerOutput>()
}

and

object SecondMapper : ObjectMappie<Input, Output>() {
    private object InnerInputMapper : ObjectMappie<InnerInput, InnerOutput>()
}

we will get an error for to::inner fromProperty from::inner as two mappers can be found: both FirstMapper.InnerInputMapper and SecondMapper.InnerInputMapper.

Expected behavior
Do not include mappers not visible from the current scope for implicit resolving when strictness.visibility is set to false, otherwise prioritize the "most" visible.

@stefankoppier stefankoppier added the bug Something isn't working label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant