Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow private constructors when using ctor attribute #530

Merged
merged 2 commits into from Aug 5, 2019

Conversation

Alxandr
Copy link
Contributor

@Alxandr Alxandr commented Jul 26, 2019

The idea here is that adding SerializationConstructor attribute to a constructor is such an explicit action/flag, that it should override any priv/nonpriv solver constraint. I would argue that the same should be the case for Key attribute and similar as well, because adding [Key(0)] to something and having it ignored because it's private is confusing. But regardless, that you can at least work around. Private constructors don't work at all as is.

I would also really like a [MessagePackObject(IgnoreByDefault = true)], so I don't have to keep doing [IgnoreMember] on all the public API. Thoughts?

Closes #40

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. @neuecc?

@neuecc
Copy link
Member

neuecc commented Aug 5, 2019

Yes, I think it's a good fix.
Thank you.

@AArnott AArnott added this to the v2.0 milestone Aug 5, 2019
@AArnott AArnott merged commit 75cd68c into MessagePack-CSharp:master Aug 5, 2019
@Alxandr Alxandr deleted the feat/priv-ctor branch August 5, 2019 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support private constructor, members
3 participants