Skip to content

Fix enum value features and STRICT visibility edition 2024 - #773

Open
emcfarlane wants to merge 1 commit into
mainfrom
ed/fix2024
Open

emcfarlane wants to merge 1 commit into
mainfrom
ed/fix2024

Conversation

@emcfarlane

Copy link
Copy Markdown
Contributor

This fixes three edition 2024 behaviors.

Enum value features were ignored. Feature lookup on builtins.EnumFeatures instead of builtins.EnumValueFeatures, so features set on an enum value were never applied or validated against the edition.

STRICT nested visibility. protoc fixed its namespaced-enum check upstream (protocolbuffers/protobuf@1229d4a, protocolbuffers/protobuf@18561e4), so no longer need the bugged warning workaround. Under STRICT, nested messages can never be exported. A nested enum can only be exported if it is inside a top-level local message with a single reserved 1 to max;.

Source spans for export/local types. protoc consumes the visibility modifier before recording a message or enum's location, so the span starts at message/enum. Comments still attach from the first token.

@emcfarlane emcfarlane changed the title Fix enum value features and STRICT visibility parity with protoc Fix enum value features and STRICT visibility edition 2024 Oct 1, 2026
@emcfarlane
emcfarlane requested a review from doriable October 2, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant