In a union, types with index signatures should contribute types to all properties #21141
Labels
Committed
The team has roadmapped this issue
Fixed
A PR has been merged for this issue
Suggestion
An idea for TypeScript
Milestone
Currently, putting a type with nothing but a string index signature in a union prevents all properties from being accessible. Instead, the type should contribute its index type to all properties:
Currently,
foo
andbaz
are not found onu
. But they should be present, and have types{ bar: true } | string
andtrue | string
respectively.The text was updated successfully, but these errors were encountered: