Please do the checklist before filing an issue:
Describe the bug
Adding a clone/copy map definition with a class that has a read-only property throws InsufficientExecutionStackException (similar to #1882 ?)
Repro
https://github.com/nas-rda/Mapperly1882Extended
Declaration code
public class Sample
{
public string Value { get; set; }
public Task? ReadonlyProperty => null;
}
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target, UseDeepCloning = true)]
public static partial class Map
{
public static partial void Copy(this Sample source, Sample target);
}
Actual relevant generated code
None. InsufficientExecutionStackException is thrown in MapperGenerator.
Expected relevant generated code
public static partial class Map
{
public static partial void Copy(this Sample source, Sample target)
{
target.Value = source.Value;
}
}
Reported relevant diagnostics
None.
Environment (please complete the following information):
- Mapperly Version: 4.3.1-next.0
- Nullable reference types: enabled
- .NET Version: 10.0.0
- Target Framework: net10.0
- Compiler Version: 18.0.2+b0f34d51f
- C# Language Version: 14.0
- IDE: Rider 2025.3.0.4
- OS: Windows 10 22H2
Workaround
Using MapperIgnoreTarget(nameof(@Sample.ReadonlyProperty)) will not cause the exception.
Please do the checklist before filing an issue:
Describe the bug
Adding a clone/copy map definition with a class that has a read-only property throws InsufficientExecutionStackException (similar to #1882 ?)
Repro
https://github.com/nas-rda/Mapperly1882Extended
Declaration code
Actual relevant generated code
None. InsufficientExecutionStackException is thrown in MapperGenerator.
Expected relevant generated code
Reported relevant diagnostics
None.
Environment (please complete the following information):
Workaround
Using
MapperIgnoreTarget(nameof(@Sample.ReadonlyProperty))will not cause the exception.