Skip to content

Commit

Permalink
Add minimization for enum_type.
Browse files Browse the repository at this point in the history
This won't have much effect over the edition zero migration, since enums in any proto2/proto3 file are either exclusively closed/open, respectively.  However, it will prefer enum-level features if there's only a single enum

PiperOrigin-RevId: 590642827
  • Loading branch information
mkruskal-google authored and copybara-github committed Dec 13, 2023
1 parent 85a134b commit 7c38dab
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import "third_party/java_src/protobuf/current/java/com/google/protobuf/java_feat
import "google/protobuf/cpp_features.proto";
import "google/protobuf/editions/proto/editions_transform_proto3.proto";

option features.enum_type = CLOSED;
option features.repeated_field_encoding = EXPANDED;
option features.utf8_validation = NONE;
option java_multiple_files = true;
Expand Down Expand Up @@ -110,6 +109,8 @@ message TestMessage {
}

enum TestEnum {
option features.enum_type = CLOSED;

FOO = 1; // Non-zero default

BAR = 2;
Expand Down

0 comments on commit 7c38dab

Please sign in to comment.