-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Closed
Labels
Description
Currently Ruby suppresses has_foo? methods for proto3:
protobuf/ruby/ext/google/protobuf_c/message.c
Lines 246 to 254 in c578f59
| // Disallow oneof hazzers for proto3. | |
| // TODO(haberman): remove this test when we are enabling oneof hazzers for | |
| // proto3. | |
| if (*f && !upb_FieldDef_IsSubMessage(*f) && | |
| upb_FieldDef_RealContainingOneof(*f) && | |
| upb_MessageDef_Syntax(upb_FieldDef_ContainingType(*f)) != | |
| kUpb_Syntax_Proto2) { | |
| return METHOD_UNKNOWN; | |
| } |
As of 2020-09-15, it was decided that all oneof fields should have hazzers, even for proto3.
We should update Ruby to support has_foo? for oneof fields in Ruby.
(Note: in this case foo is the name of a field in a oneof, foo is not a oneof itself).
Reactions are currently unavailable