Skip to content

Add computed property names (compile-time support only)#1658

Merged
TwitchBronBron merged 9 commits intomasterfrom
feature/support-enum-and-constants-as-keys
Mar 24, 2026
Merged

Add computed property names (compile-time support only)#1658
TwitchBronBron merged 9 commits intomasterfrom
feature/support-enum-and-constants-as-keys

Conversation

@chrisdp
Copy link
Copy Markdown
Contributor

@chrisdp chrisdp commented Mar 24, 2026

No description provided.

@chrisdp chrisdp linked an issue Mar 24, 2026 that may be closed by this pull request
@TwitchBronBron TwitchBronBron changed the title first pass at emun and const as key values Enums and consts as key values Mar 24, 2026
@TwitchBronBron TwitchBronBron changed the title Enums and consts as key values Support compile-time constants as AA keys Mar 24, 2026
@TwitchBronBron TwitchBronBron changed the title Support compile-time constants as AA keys Support enum and const values as AA keys Mar 24, 2026
@TwitchBronBron TwitchBronBron changed the title Support enum and const values as AA keys Add computed property names support (compile-time support only) Mar 24, 2026
@TwitchBronBron TwitchBronBron changed the title Add computed property names support (compile-time support only) Add computed property names (compile-time support only) Mar 24, 2026
Comment on lines +422 to +426
expectedRightSquareBracketAfterAAComputedKey: () => ({
message: `Expected ']' after associative array computed key expression`,
code: 1144,
severity: DiagnosticSeverity.Error
}),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think a simple expectedToken is probably fine, no need to make a separate diagnostic for essentially the same problem.

Also, let's move these down to the bottom of this file.

@TwitchBronBron TwitchBronBron enabled auto-merge (squash) March 24, 2026 19:35
@TwitchBronBron TwitchBronBron merged commit adf045c into master Mar 24, 2026
7 checks passed
@TwitchBronBron TwitchBronBron deleted the feature/support-enum-and-constants-as-keys branch March 24, 2026 19:36
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.

Using Enums and constants as keys when explicitly declaring AAs

2 participants