Skip to content

Ruby oneof fields should have has_foo?, even for proto3 files #9561

@haberman

Description

@haberman

Currently Ruby suppresses has_foo? methods for proto3:

// 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).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions