Skip to content

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

@stefankoppier

Description

@stefankoppier

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions