Please do the checklist before filing an issue:
Describe the bug
I have a project A (or nuget package) with disabled nullability. Project B with enabled nullability, which references project A.
When mapping string property from type from project A to type from project B, Mapperly reports RMG089
Mapping the nullable source property Id of NonNullableDtos.EntityDto to the target property Id of MapperlyRepro.Entity which is not nullable
However, source property is not nullable - it does not report any nullability at all.
Since C# does not report any warnings in such case, I expect Mapperly to not report any warnings as well.
Repro
MapperlyRepro.zip
Declaration code
#nullable disable
public class EntityDto
{
public string Id { get; set; }
}
#nullable enable
public class Entity
{
public required string Id { get; set; }
}
[Mapper]
public static partial class Mapper
{
public static partial Entity MapFromDto(this EntityDto dto);
}
Reported relevant diagnostics
- RMG089 - Mapping the nullable source property Id of NonNullableDtos.EntityDto to the target property Id of MapperlyRepro.Entity which is not nullable
Environment (please complete the following information):
- Mapperly Version: 4.3.0-next.3
- Nullable reference types: both
- Target Framework: .net8.0
- Compiler Version: '4.14.0-3.25412.6 (c167adef)'
- C# Language Version: 12.0
- IDE: Version 17.14.13 (August 2025)
- OS: Windows
Please do the checklist before filing an issue:
Describe the bug
I have a project A (or nuget package) with disabled nullability. Project B with enabled nullability, which references project A.
When mapping string property from type from project A to type from project B, Mapperly reports RMG089
However, source property is not nullable - it does not report any nullability at all.
Since C# does not report any warnings in such case, I expect Mapperly to not report any warnings as well.
Repro
MapperlyRepro.zip
Declaration code
Reported relevant diagnostics
Environment (please complete the following information):