Sitelet https://github.com/MessagePack-CSharp/MessagePack-CSharp/issues/1919
Skip to content

AOT must accommodate init and required properties #1919

Description

@AArnott

In migrating one of my apps to MessagePack v3, I hit a roadblock in that the auto-generated formatter doesn't use the object initializer syntax to set properties with init property accessors. As a result, the project no longer compiles.

Since the system already knows to deserialize property values required by the constructor before invoking the constructor, it should be a relatively simple matter to also collect init properties before invoking the constructor, and then to set the properties using object initializer syntax.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions