Mapped properties in interfaces have undefined behavior #18299
Labels
Bug
A bug in TypeScript
Domain: Error Messages
The issue relates to error messaging
Fix Available
A PR has been opened for this issue
Help Wanted
You can do this
Milestone
TypeScript Version: Playground version
Code
Linked playground
Expected behavior:
One of these two options:
[foo in bar]
is required to be a valid class property/method name).Actual behavior:
A mess of type errors because
[P in T]: any
is parsed in interfaces as a computed symbol property with keyP in T
(i.e. a boolean). In kind, I get three sets of type errors:For
P
:For
'a' | 'b'
:The text was updated successfully, but these errors were encountered: