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.3.2 Code
export function array<T>(array: T[], body: (element: T, i: number) => void) { Array.prototype.forEach.call(array, body); } export function object<T>(o: T, body: <U extends keyof T>(element: T[U], i: U) => void) { array(Object.keys(o), function (key, i) { body(o[key], key); }); }
Expected behavior: No compile error
Actual behavior: Compile error
severity: 'Error' message: 'Argument of type 'string' is not assignable to parameter of type 'keyof T'.' at: '10,22' source: 'ts'
The text was updated successfully, but these errors were encountered:
See #13254 and this comment. This is by design.
Sorry, something went wrong.
Thanks for finding that @hediet
No branches or pull requests
TypeScript Version: 2.3.2
Code
Expected behavior:
No compile error
Actual behavior:
Compile error
The text was updated successfully, but these errors were encountered: