You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When indexing an object with a template string, the template string is typed just as string instead of the proper union, causing an error and requiring a type cast or ts-ignore to rid.
π Expected behavior
The template string typing to be used to check for valid indexing
The text was updated successfully, but these errors were encountered:
With #44512 we will indeed give template literal types to template literal expressions in index positions. Meanwhile, it works with an explicit const assertion fontSizes[`h${level}` as const].
Uh oh!
There was an error while loading. Please reload this page.
Bug Report
π Search Terms
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
When indexing an object with a template string, the template string is typed just as
string
instead of the proper union, causing an error and requiring a type cast or ts-ignore to rid.π Expected behavior
The template string typing to be used to check for valid indexing
The text was updated successfully, but these errors were encountered: