Skip to content

Supports for constant defined keys - #1

Merged
merschformann merged 3 commits into
mainfrom
merschformann/support-const-defined-keys
Apr 17, 2026
Merged

Supports for constant defined keys#1
merschformann merged 3 commits into
mainfrom
merschformann/support-const-defined-keys

Conversation

@merschformann

Copy link
Copy Markdown
Owner

Description

Support map keys defined via const instead of string literals, and expand test coverage across all supported styles.

Changes

  • Switch load mode to LoadModeTypesInfo so the analyzer can resolve constant values via pass.TypesInfo
  • When a key is an identifier, resolve it to its const string value and check that instead of checking the identifier name
    • Non-constant (var) identifiers are silently skipped since their value is not statically knowable
  • Improve test coverage and fix some tests.

@merschformann
merschformann merged commit 96f9a3a into main Apr 17, 2026
2 checks passed
@merschformann
merschformann deleted the merschformann/support-const-defined-keys branch April 17, 2026 16:22
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