8000 Preserve nil values in generic type map by dajiaohuang · Pull Request #1781 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Preserve nil values in generic type map - #1781

Closed
dajiaohuang wants to merge 5 commits into
dominikh:masterfrom
dajiaohuang:fix/generic-typeutil-map-nil
Closed

dajiaohuang wants to merge 5 commits into
dominikh:masterfrom
dajiaohuang:fix/generic-typeutil-map-nil

Conversation

@dajiaohuang
@dajiaohuang dajiaohuang commented Oct 1, 2026 •
Copy link
Copy Markdown

The generic Map wrapper uses the upstream map's nil return to distinguish missing keys, so a stored nil value is reported as absent. Box values before storing them to preserve presence independently of V, including during iteration. Add a regression test for Set(key, nil), At, and Iterate.

Review update: the unrelated generic-instantiation change and its fixture were removed through a normal follow-up commit; #1764 tracks that fix separately. Current-head validation: go test ./go/types/typeutil (four tests) passed; git diff --check passed. Prior validation text above is historical unless repeated here.

@dajiaohuang dajiaohuang closed this Oct 8, 2026
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

0