Skip to content

Uncompilable code generated for repeated groups #100

Open

Description

Groups are deprecated feature, but still available for use in proto2.

Following proto leads to uncompilable output:

syntax = "proto2";

message MyMessage {
    repeated group Group = 1 {
        optional int32 i32 = 1;
    }
}

Generated message contains slice of struct generated for group:

Group []*MyMessage_Group `protobuf:"group,1,rep,name=Group,json=group" json:"group,omitempty"`

VtProto generates code as it's just a message, not a slice:

size, err := m.Group.MarshalToSizedBufferVT(dAtA[:i])

l = m.Group.SizeVT()

m.Group.UnmarshalVT(dAtA[groupStart:maybeGroupEnd])

Expected behaviour: to handle it as list of messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions