Skip to content

parse: proto3 enum without zero value accepted; implicit default becomes nonzero #11

Description

@JavaGT

Lane: reflection/parse (sweep 2, finding 5)
No first-value-must-be-zero check for proto3 enums (src/parse.js:694-728), and src/field.js:346-351 picks the implicit default as the first defined key — so a proto3 message field's default can become nonzero (spec requires 0). Also a key-order quirk for out-of-order zero values.

Repro (executed): enum E { A = 1; } + proto3 field → typeDefault === 1.

Verdicts: both Confirm, Worth exploring (invalid proto / order quirk).

Upstream: no match.

Decision question: Adopt (parse-time validation for proto2/proto3; keep first-key default only where legal) or Reject?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions