Skip to content

"Map fields are not allowed in oneofs" #7542

Open
@jkopczyn

Description

@jkopczyn

What version of protobuf and what language are you using?
Version: libprotoc 3.6.1 (proto3 syntax explicitly set in the source)
Language: Go

What operating system (Linux, Windows, ...) and version?
Linux, specifically gLinux Rodete

What runtime / compiler are you using (e.g., python version or gcc version)
I don't think that's a meaningful question here.

What did you do?
Steps to reproduce the behavior:

syntax = "proto3";

package foo;

message Step {

  oneof args_spec {
    map<string, string> arbitrary_args = 3;

    Empty empty_args = 4;
  }
}

message Empty {}

$ protoc foo.proto --go_out=.

What did you expect to see
"You can add fields of any type, but cannot use repeated fields.", so I expected to get a foo.pb.go file.

What did you see instead?
foo.proto:8:8: Map fields are not allowed in oneofs.

Anything else we should know about your project / environment
I'm using the Chrome infrastructure package manager, CIPD, to install protoc. That's probably not relevant, but might be.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions