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

C# wrapper types #611

Merged
merged 5 commits into from
Jul 17, 2015
Merged

Conversation

jskeet
Copy link
Contributor

@jskeet jskeet commented Jul 16, 2015

This is ready for an initial review, but I wouldn't be surprised if we wanted some more changes before merging.

@jtattermusch @anandolee

jskeet added 3 commits July 16, 2015 09:36
- 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 } },
};
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doh! Will fix :)

@jskeet
Copy link
Contributor Author

jskeet commented Jul 16, 2015

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@jtattermusch
Copy link
Contributor

Thanks for contributing this!
The changes LGTM, but I had some minor comments.
Because of timezone issues, feel free to merge this PR yourself once you address them.

@jskeet
Copy link
Contributor Author

jskeet commented Jul 17, 2015

Thanks. Pushed the changes - waiting for CI, then will merge.

jskeet added a commit that referenced this pull request Jul 17, 2015
@jskeet jskeet merged commit 0f442a7 into protocolbuffers:csharp-experimental Jul 17, 2015
@jskeet jskeet deleted the csharp-wrappers branch July 17, 2015 06:30
bithium pushed a commit to bithium/protobuf that referenced this pull request Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants