Commit Graph

7382 Commits

Author SHA1 Message Date
Jan Tattermusch
0611563e76
Merge pull request #7448 from jtattermusch/csharp_selfreferential_options
C# Add tests for self-referential options
2020-05-11 13:15:29 +02:00
Jan Tattermusch
0757d8ee5c update Makefile.am 2020-05-11 11:24:48 +02:00
Jan Tattermusch
dd013bdf06 regenerate protos 2020-05-11 11:18:49 +02:00
Jan Tattermusch
661c0c4eb8 add tests for selfreferential options 2020-05-11 11:18:49 +02:00
Jan Tattermusch
bf3eef94c1
Merge pull request #7434 from jtattermusch/csharp_expose_options
C#: Get rid of broken GetOption API and expose the "GetOptions()" method on descriptors instead
2020-05-11 09:40:51 +02:00
Daniel Kurka
bb3460d71b Project import generated by Copybara
PiperOrigin-RevId: 310614231
2020-05-08 13:06:41 -07:00
Leo
12236c6977 Fix typo on py_proto_library 2020-05-08 09:34:26 -07:00
Aleksandr Parfenov
5efd1215f5 Update comment for GetRepeatedFieldRef
Use just reflection.h in documentation instead of full path
2020-05-08 09:27:47 -07:00
Aleksandr Parfenov
b60d9f2d6b Fix include path to reflection.h in documentation
There is a note in the documentation to `Reflection::GetRepeatedFieldRef()`
about file `net/proto2/public/reflection.h` which contains a definition of
`RepeatedFieldRef`. Since there are few places in code with rewrite of
`net...` path to `google/protobuf/...` it looks like the first one is a
legacy path and should be renamed to `google/protobuf` in documentation
as well.
2020-05-08 09:27:47 -07:00
Jon Skeet
6b0ff74ecf Implement HasPresence for C#
FieldDescriptor.HasPresence returns true if both ClearValue and HasValue (on the accessor) can be expected to work. Some fields have a working ClearValue, but no HasValue; HasPresence returns false for those fields.

Generally:

- Extension fields have presence if and only if they're singular
- Repeated fields do not support presence
- Map fields do not support presence
- Message fields support presence
- Oneof fields support presence (this includes synthetic oneof fields, so that covers proto3 optional singular fields)
- Proto2 singular primitive fields support presence
- Proto3 singular primitive fields do not support presence (unless they're in a oneof, covered above)
2020-05-08 06:17:50 +01:00
Joshua Haberman
cac7136436
Merge pull request #7477 from haberman/sync-stage
Integrate from Piper for C++, Java, and Python
2020-05-07 22:00:22 -07:00
Daniel Kurka
ed596ef68d Project import generated by Copybara
PiperOrigin-RevId: 310497816
2020-05-07 21:53:47 -07:00
Joshua Haberman
c00c60eb1c Added new failures to PHP C lists also (and sorted). 2020-05-07 18:30:47 -07:00
Joshua Haberman
dfff1ac2cf Added new failing conformance test to Ruby, PHP, and C#. 2020-05-07 17:10:11 -07:00
Joshua Haberman
81c5959e67 Merge branch 'sync-piper' into sync-stage 2020-05-07 16:21:50 -07:00
Joshua Haberman
2d80a70048 Sync from Piper @310457838
PROTOBUF_SYNC_PIPER
2020-05-07 16:21:50 -07:00
Joshua Haberman
c781df3d21
Updated generated code for C#. (#7476) 2020-05-07 16:19:28 -07:00
Jan Tattermusch
0688883b52 address review comments 2020-05-06 18:53:36 +02:00
Joshua Haberman
2ac29ae5d4 Sync from Piper @310014675
PROTOBUF_SYNC_PIPER
2020-05-05 13:56:07 -07:00
Joshua Haberman
204f99488c
Use the name from the descriptor instead of RTTI. (#7465) 2020-05-05 10:56:48 -07:00
Joshua Haberman
7eb207c574
Merge pull request #7464 from haberman/sync-stage
Integrate from Piper for C++, Java, and Python
2020-05-05 10:56:21 -07:00
Jan Tattermusch
a690227398
Merge pull request #7351 from jtattermusch/protobuf_csharp_new_parsing
New Span-based C# parsing logic
2020-05-05 16:57:52 +02:00
Joshua Haberman
c05b55880f Sync from Piper @309848308
PROTOBUF_SYNC_PIPER
2020-05-04 17:10:15 -07:00
Joshua Haberman
1119531bb2 Merge branch 'sync-piper' into sync-stage 2020-05-04 17:10:15 -07:00
Paul Yang
317bc83444
Ignore unknown enum value when ignore_unknown specified (#7455) 2020-05-04 14:34:05 -07:00
Jon Skeet
ed5c874de3 Fix to C# support library code
(This was the only use of a HasXyz property for a message type.)
2020-05-01 09:06:44 +01:00
Jon Skeet
9926c9504b Regenerate C# code based on the previous commit
(This removes the Has/Clear members for message types in proto2.)
2020-05-01 09:06:44 +01:00
Jon Skeet
9d74aafbe1 Don't generate Has/Clear members for proto2 message fields.
This is a breaking change in terms of proto2 code generation: users who were previously using these members will have to change to null checks for message fields.
After toying with removing Has/Clear for proto2 oneof fields, I've left them alone in this commit, for consistency with other languages. The inconsistency between proto2 and proto3 won't come up here, because proto3 oneof fields can never be explicitly optional.

Fixes #7395.
2020-05-01 09:06:44 +01:00
Michael WERLE
02f182e829 Clean up nortti fix based on comments from @acozzette
Also moved the macro into the only function which is using it to keep the fix local to the issue.
2020-04-29 10:42:37 -07:00
Michael WERLE
1d461e7825 Fix when compiling without RTTI 2020-04-29 10:42:37 -07:00
Jan Tattermusch
ff999c9d42 clarify docs 2020-04-29 08:57:53 +02:00
Jan Tattermusch
673245f212 remove unnecessary cast 2020-04-29 08:50:59 +02:00
Thomas Van Lenten
2db0e9812a Use the new helpers from Descriptor. 2020-04-28 16:22:53 -04:00
Jan Tattermusch
402ce8b17f add back GetOption tests 2020-04-28 19:25:06 +02:00
Jan Tattermusch
062c2dc24b add back GetOption methods, but mark them as obsolete 2020-04-28 19:14:27 +02:00
Joshua Haberman
4b4e667435
Merge pull request #7435 from haberman/sync-stage
Integrate from Piper for C++, Java, and Python
2020-04-28 09:52:24 -07:00
Nick Presta
75553e9ec8 Update shell format in installation instructions. 2020-04-28 08:51:04 -07:00
Joshua Haberman
32e5deb1ac Sync from Piper @308829107
PROTOBUF_SYNC_PIPER
2020-04-28 08:40:38 -07:00
Joshua Haberman
140e1bb70e Merge branch 'sync-piper' into sync-stage 2020-04-28 08:40:38 -07:00
Jan Tattermusch
f4ff22026b add a few more tests 2020-04-28 13:59:54 +02:00
Jan Tattermusch
9720ae41c2 adjust CustomOptionsTest.cs 2020-04-28 12:49:29 +02:00
Jan Tattermusch
944055a683 expose Options property on descriptors 2020-04-28 10:49:49 +02:00
Greg Steuck
4059c61f27
Typo in 'disciplines' (#7423) 2020-04-27 08:21:52 -07:00
Jan Tattermusch
7134d25eb8 Merge remote-tracking branch 'upstream/master' into protobuf_csharp_new_parsing 2020-04-27 13:18:07 +02:00
Thomas Van Lenten
dddeed298b [ObjC] Typos and comment improvements. 2020-04-24 16:36:15 -04:00
Thomas Van Lenten
7b6016e343 [ObjC] Add tests for proto3 optional behaviors. 2020-04-24 16:36:15 -04:00
Thomas Van Lenten
b0e2792842 [ObjC] Generation changes around proto3 optional.
- Bump the version marker in the generated code.
- Set the flag to say clear on zero is known.
- Set clear on zero for proto3 optional fields that aren't tagged as optional.
- Also tweak the call from some C generated code to use different apis with
  better validation.
- Mark the ObjC generator as supporting the proto3 optional feature.
- Regenerate the WKTs to get the new flags.
2020-04-24 16:36:15 -04:00
Thomas Van Lenten
3c8e959b60 [ObjC] Update oneof clearing internals.
- Add/document an public api for clearing oneofs.
- Move the current library internals to a new api and keep a shim for old
  generated code.
2020-04-24 16:36:15 -04:00
Thomas Van Lenten
e1e5b8af79 [ObjC] Update some library internals to not pass syntax versions.
- With the new flags, the syntax isn't needed, so don't pass it.
- To keep library binary compatibility, rename the helpers since one
  "Internal" method was called from generated code. Keep a shim with
  the old signature to support those generated sources.
2020-04-24 16:36:15 -04:00
Thomas Van Lenten
8d224b4c48 [ObjC] Runtime support for proto3 optional.
- Add a Descriptor flag to capture if the field should clear on being zeroed.
- Update the runtime to use the new clear on zero flag.
- Add a flag on message initialization to indicate the sources were generated
  with/without this support so the runtime can backfill the flag for older
  generated sources.
2020-04-24 16:36:15 -04:00