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
Versions[ver] errors with Element implicitly has an 'any' type because expression of type '`${string}.${string}`' can't be used to index type 'Record<`${string}.${string}`, string>'. (??)
🙂 Expected behavior
TypeScript recognises that `${string}.${string}` === the key of Record<`${string}.${string}`,string>
The text was updated successfully, but these errors were encountered:
Nixinova
changed the title
Cannot index record with own type
Cannot index record with own key type
Jul 22, 2021
Seems to be a duplicate of #40193 which in turn is marked as a duplicate of #37448 though I don't really understand the latter as the issue is philosophically worded.
Why doesn't my code work and how can I fix it? I'll close when that's answered.
Bug Report
🔎 Search Terms
Element implicitly has an 'any' type because expression of type X can't be used to index type 'Record<X, Y>'
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Versions[ver]
errors withElement implicitly has an 'any' type because expression of type '`${string}.${string}`' can't be used to index type 'Record<`${string}.${string}`, string>'.
(??)🙂 Expected behavior
TypeScript recognises that
`${string}.${string}`
=== the key ofRecord<`${string}.${string}`,string>
The text was updated successfully, but these errors were encountered: