Skip to content

Split exact and lower-cased name lookup into two maps - #128

Merged
dmarkham merged 1 commit into
masterfrom
fix-case-overlap
Oct 3, 2026
Merged

dmarkham merged 1 commit into
masterfrom
fix-case-overlap

Conversation

@dmarkham

@dmarkham dmarkham commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Fixes #40. Based on #97 by @gabe565, rebuilt on current master.

Names that differ only by case shared one lookup map, so the lower-cased entry for one constant overwrote the exact entry for another:

CasecollisionString("example") = EXAMPLE   // wanted example

Exact and lower-cased names are now in separate maps. Exact spelling is checked first, lower-case second. Case-insensitive lookups work as before; only colliding names change result.

  • enumer.go: one map printer called twice
  • goldens regenerated
  • testdata/casecollision.go: end-to-end regression test, fails on master

Names that differ only by case shared one map, so the lower-cased entry
for one constant overwrote the exact entry for another and TString()
returned the wrong value. Exact names and lower-cased names now live in
separate maps; exact spelling is checked first, lower-case second.

Case-insensitive lookups behave as before. Regenerated code only changes
result for names that collide by case.

Based on #97 by gabe565. Fixes #40.
@dmarkham
dmarkham merged commit bbfee7b into master Oct 3, 2026
3 checks passed
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.

Flag for case sensitive in <Type>String(s string)

1 participant