Please do the checklist before filing an issue:
Describe the bug
Code generation is broken in Riok.Mapperly versions 5.0.0-next.4 and 5.0.0-next.5 when mapping method contains additional parameter. Earlier versions generate proper code.
Repro
This repository demonstrates the issue: https://github.com/kockicica/mapperly-test
Actual relevant generated code
[global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "5.0.0.0")]
private global::Data.ScenarioAction MapToScenarioAction(global::Model.ScenarioAction source)
{
var target = new global::Data.ScenarioAction();
if (id != null)
{
target.Id = id.Value;
}
target.Name = source.Name;
target.Type = source.Type;
target.Required = source.Required;
target.Duration = source.Duration;
if (source.Params != null)
{
target.Params = new global::System.Collections.Generic.Dictionary<string, object>(source.Params);
}
else
{
target.Params = null;
}
return target;
}
Expected relevant generated code
[global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "5.0.0.0")]
private global::Data.ScenarioAction MapToScenarioAction(global::Model.ScenarioAction source)
{
var target = new global::Data.ScenarioAction();
target.Id = source.Id;
target.Name = source.Name;
target.Type = source.Type;
target.Required = source.Required;
target.Duration = source.Duration;
if (source.Params != null)
{
target.Params = new global::System.Collections.Generic.Dictionary<string, object>(source.Params);
}
else
{
target.Params = null;
}
return target;
}
Environment (please complete the following information):
- Mapperly Version: 5.0.0-next.4 and 5.0.0-next.5
- Target Framework: net10.0
- Compiler Version: 5.3.0-2.26153.122 (4d3023de605a78ba3e59e50c657eed70f125c68a)
- C# Language Version: 14.0
- OS: Windows 11
Please do the checklist before filing an issue:
Describe the bug
Code generation is broken in Riok.Mapperly versions 5.0.0-next.4 and 5.0.0-next.5 when mapping method contains additional parameter. Earlier versions generate proper code.
Repro
This repository demonstrates the issue: https://github.com/kockicica/mapperly-test
Actual relevant generated code
Expected relevant generated code
Environment (please complete the following information):