-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
C# wrapper types #611
C# wrapper types #611
Conversation
- We do still generate the message types, as otherwise reflection breaks, even though it doesn't actually use those types. - JSON handling hasn't been implemented yet
StringField = { { 11, "First" }, { 12, "Second" }, { 13, "" }, { 14, null } }, | ||
Uint32Field = { { 15, uint.MaxValue }, { 16, uint.MinValue }, { 17, 0U } }, | ||
Uint64Field = { { 18, ulong.MaxValue }, { 19, ulong.MinValue }, { 20, 0UL } }, | ||
}; |
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.
This test doesn't test anything.
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.
Doh! Will fix :)
Done. |
|
||
// Merging is odd with wrapper types, due to the way that default values aren't emitted in | ||
// the binary stream. In fact we cheat a little bit - a message with an explicitly present default | ||
// value will have that default value ignored. |
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.
Let's add a test that parses an IntWrapper from a stream that has the default value set explicitly. Comment of that test can describe that this is actually not the ideal behavior, but that's the way it's implemented now.
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.
Happy to do so, but will be in the morning.
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.
Done - and added a fairly simple oneof test too.
Thanks for contributing this! |
Thanks. Pushed the changes - waiting for CI, then will merge. |
C# wrapper types
This is ready for an initial review, but I wouldn't be surprised if we wanted some more changes before merging.
@jtattermusch @anandolee