-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add spec: deserializing objects with parameterized ctors #33095
Conversation
3006d2b
to
68f22e2
Compare
68f22e2
to
fa1ed91
Compare
a913b80
to
9063bf8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise; looks great.
with a message stating that objects without public parameterless constructors, including `interface`s and `abstract` | ||
types, are not supported for deserialization. There is no way to deserialize an instance of an object using a parameterized constructor. | ||
|
||
A common pattern is to make data objects immutable for various reasons. For example, given `Point`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that this change alone won't support all immutable types. For example, our own immutable collections don't use constructors but factory methods.
Contributes to #29895.