Skip to content

parse: honor named targets in cast shims - #456

Open
SAY-5 wants to merge 1 commit into
tinylib:masterfrom
SAY-5:fix-named-cast-shims-20261001
Open

SAY-5 wants to merge 1 commit into
tinylib:masterfrom
SAY-5:fix-named-cast-shims-20261001

Conversation

@SAY-5

@SAY-5 SAY-5 commented Oct 2, 2026

Copy link
Copy Markdown

Named as: targets were classified as IDENT without enabling conversion, so cast shims ignored their using: serializer. Pointer shims could generate invalid expressions such as &field.MarshalMsg(...). Enable conversion locally for named cast shims; primitive shims, ordinary aliases, and mode:convert retain their existing behavior.

Fixes #439. The regression generates a named map serializer and checks wire bytes, all five methods, zero-value decoding, nil pointers, container fields, and decode errors. The same valid fixture fails to compile with the upstream generator.

Validation on Go 1.26.2 / macOS ARM64:

  • 824 top-level tests, 1,055 passing test/subtest outcomes across the generator, runtime, setof, and generated fixtures.
  • go vet, gofmt, and CI-pinned golangci-lint 2.5.0 (./...) pass.
  • TinyGo, TestConv32, TestConv64, TestReadIntfRecursion, TestSkipRecursion, fuzzing, and benchmarks were not run locally.

AI assistance: Codex assisted with the implementation, tests, and description. A separate agent reviewed the change.

@klauspost klauspost left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

Shimming to an IDENT type

2 participants