Init properties aren't deserialized
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.7k
- Forks
- 313
- PR merge metrics
- No merged PRs in 30d
Description
Hi, if I have a class with init properties:
[MemoryPackable(GenerateType.CircularReference, SerializeLayout.Sequential)]
public partial class MyClass
{
public string? Data { get; init; }
}
then Data property is not deserialized. Although original object has real value in this property, also serialized object has, but during deserialization is not assigned at proper time and it's just lost.
Also MemoryPack constructor cannot be used, because it expects a parameterless constructor in CircularReference generation.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown MyClass example using CircularReference and Sequential serialization, then inspect the generated deserialization path and MemoryPack constructor handling. Confirm that Data is assigned during deserialization and that the constructor limitation is addressed without losing circular-reference behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100