-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Index Signatures break Mapped type key picking. #30293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
simple repro:/** type used to demonstrate the bug */
type TestType ={
b: boolean;
[ key: string ]: boolean;
}
let testSimple: Pick<TestType, keyof TestType>;
testSimple; //no properties in vscode intellisense dropdown, nor available in type propagation (unioning, etc). comment the index signature to get properties. |
This is related to: #17867 |
I think both of those are fairly inarguable given the definition of both operations. |
sorry @RyanCavanaugh, not following you, I don't spend enough time with type definitions I guess :/ Maybe my "simple" repro muddys the issue. I want to do as shown in the initial post: remove a property, but can not when an index signature is in the type. |
Update: Please see the second comment, titled "simple repro"
Summary
I'm trying to create type definitions for a mixin object. when doing so I found the following error if one of the mixed types has an index signature.
removing the index signature "fixes" the problem.
TypeScript Version: 3.3.3333
Code
Expected behavior:
Actual behavior:
Related Issues: didn't really see any :(
The text was updated successfully, but these errors were encountered: