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
Bug
I'm trying to use an object's key to index an intersection into a partial of an object and another object, but I'm getting an error.
Note: this error only shows up in a generic class. Using plain types I was not able to replicate it.
it is actually (Rum & Partial<T>)[keyof T], which is generic, and not assignable to string | number, since T can have additional properties when it is instantiated.
Bug
I'm trying to use an object's key to index an intersection into a partial of an object and another object, but I'm getting an error.
Note: this error only shows up in a generic class. Using plain types I was not able to replicate it.
TypeScript Version:
2.7.1-insiders.20180127 (playground)
2.3.1 (visual studio tools)
2.7.2 (command line)
Search Terms:
Keyof, intersection, union, Partial, index, merge.
Code
Expected behavior:
No errors.
Actual behavior:
test.ts(13,25): error TS2536: Type 'keyof T' cannot be used to index type 'Rum & Partial'.
Playground link
The text was updated successfully, but these errors were encountered: