We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
TypeScript Version: 2.1.5 and 2.2.0-dev.20170206
If we take the code meant to solve React's setState typings from here #12793
Code
function setState<T, K extends keyof T>(obj: T, state: Pick<T, K>) { for (let k in state) { obj[k] = state[k] } } interface Foo { a: string b: number } let foo: Foo = { a: "hello", b: 42 } const someIndex = 8000 setState(foo, { [someIndex]: 'whatever' })
Expected behavior: This should not compile. 8000 is not part of the keys of Foo
The text was updated successfully, but these errors were encountered:
Any chance this could make it for 2.3?
Sorry, something went wrong.
@ahejlsberg bug or something else going on here?
Good news, this is now fixed in TS 2.6.1
No branches or pull requests
TypeScript Version: 2.1.5 and 2.2.0-dev.20170206
If we take the code meant to solve React's setState typings from here #12793
Code
Expected behavior:
This should not compile. 8000 is not part of the keys of Foo
The text was updated successfully, but these errors were encountered: