Skip to content

Multiple MemberConverters with inheritance only uses one MemberConverter #1598

@CommonGuy

Description

@CommonGuy

Describe the bug

The MemberConverter does not work correctly with inheritance. If a MemberConverter is registered for both a base class and a sub class, the verifier only uses the "first" (depending on the internal Dictionary order) MemberConverter.

IMO both MemberConverters should be invoked.

Minimal Repro

VerifierSettings.MemberConverter<BaseClass, string>(
  x => x.Field,
  x => "changed");

// This will be effectively ignored by the verifier, as the BaseClass matches first
// If this would be registered first, then it would be used, but not the BaseClass member converter
VerifierSettings.MemberConverter<SubClass, string>(
  x => x.AnotherField,
  x => "scrubbed");

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