Skip to content

Duplicate Mappings of generics throwing an exception #4308

@tiasmt

Description

@tiasmt

Mapping configuration

protected override MapperConfiguration CreateConfiguration() => new(cfg =>
    {
        cfg.CreateMap(typeof (Source<>), typeof (Dest<>));
        cfg.CreateMap(typeof (Source<>), typeof (Dest<>));
    });

Version: 12.0.1

Expected behavior

Maps are created and when calling mapperConfiguration.AssertConfigurationIsValid(); an error is thrown. (Same as when adding duplicate mappings of non open generics)

Actual behavior

Maps are not created and a duplicate key exception is thrown.

Steps to reproduce

Run the GenericsTests changing the Create Configuration as per above snippet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions