-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Primitive literals in computed property names #4653
Copy link
Copy link
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Looking at #4648 brought this up -
We should allow string literals in computed property names in interfaces. Right now we only allow well-know symbols, but allowing all primitive literals (of valid indexer types, I suppose) should be supported.
This is a spec change - section 2.2.3 would need to be updated to reflect this, but, IMO, is fairly important and worth the change. We can't strongly type, say,
tslint.jsonresult structures right now, as we lack this.