I've written a project to test the performance of various mappers at different tasks, and it looks to have uncovered an issue in Mapster's deep-cloning.
The object being cloned has the following members (among others):
As you can see from the screenshot, the post-mapping, cloned object has its FooArray elements and Ints properties copied, instead of mapped - that is, the values from the source object are being used directly instead of being cloned.
for foo.FooArray == foo.Adapt<Foo>().FooArray, this cannot reproduce in current source. But it can be reproduced from latest package. I dig into history, this had been fixed since August, but it might not yet been published. (sorry for this)
foo.FooArray == foo.Adapt<Foo>().FooArray
For IEnumerable<int>, I intentional reuse the same object (for enumerable of primitive) just because I think that IEnumerable is readonly by type definition. Originally, I built Mapster for mapping poco to dto only. But this test case is valid, I will fix this. Thank you.
No problems :)
fix #89 Object not being mapped during Deep Clone