Skip to content

Commit

Permalink
Add a oneof with several message fields to inspect the codegen for a …
Browse files Browse the repository at this point in the history
…future

optimization.

PiperOrigin-RevId: 716780695
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Jan 17, 2025
1 parent c58621b commit 0948553
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
25 changes: 25 additions & 0 deletions editions/golden/test_messages_proto2_editions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -640,3 +640,28 @@ message TestAllRequiredTypesProto2 {
];
}
}

message TestLargeOneof {
message A1 {
}

message A2 {
}

message A3 {
}

message A4 {
}

message A5 {
}

oneof large_oneof {
A1 a1 = 1;
A2 a2 = 2;
A3 a3 = 3;
A4 a4 = 4;
A5 a5 = 5;
}
}
15 changes: 15 additions & 0 deletions src/google/protobuf/test_messages_proto2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,18 @@ message TestAllRequiredTypesProto2 {
required int32 i = 9;
}
}

message TestLargeOneof {
message A1 {}
message A2 {}
message A3 {}
message A4 {}
message A5 {}
oneof large_oneof {
A1 a1 = 1;
A2 a2 = 2;
A3 a3 = 3;
A4 a4 = 4;
A5 a5 = 5;
}
}

0 comments on commit 0948553

Please sign in to comment.