mirror of
https://github.com/apple/swift-protobuf.git
synced 2026-05-17 10:20:36 +00:00
747d8b0205
# Motivation Swift protobuf currently generates exhaustive (aka frozen) enums; however, in proto3 enums and oneofs are open and it is binary and wire compatible to add new cases to either. # Modifications This PR introduces a new generator option called `EnumGeneration` that allows developers to add the newly introduced `@nonexhaustive` attribute to enums. Because adding this attribute is a source breaking change the default stays the same as it currently is. Additionally, this PR adds multiple tests for the protoc plugin and SwiftPM plugin. # Result We can now generate `@nonexhaustive` enums and oneofs.