Object values are not assignable when wrapped in a Partial #26266
Labels
Bug
A bug in TypeScript
Domain: Mapped Types
The issue relates to mapped types
Fixed
A PR has been merged for this issue
Milestone
TypeScript Version: Version 3.1.0-dev.20180807
Search Terms: keyof mapped partial
Code
Compiled with
--strictNullChecks
:Expected behavior:
The code compiles without errors.
Actual behavior:
The compiler dislikes the
valueMap["foo"]
assignment:Tested versions:
Changing the code to remove the
Partial
and using a type assertion seems to work:Getting rid of the
keyof
and explicitly providing a list of keys also works:Playground Link: Playground Link
Related Issues: #25010 maybe?
The text was updated successfully, but these errors were encountered: