-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Type <generic> cannot be used to index type <array> #15768
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
I have a simular issue .
Expected behavior: Actual behavior: |
Temp workaround from here: throw the generic through another type that outputs a |
Hm, not having as much luck with that workaround anymore on nightlies, maybe related to #17455. Here's another bigger example showing it fails when generics are involved even if separated by operations that would work:
|
I think the cause here is |
PR at #17767. |
loosen number index check, fixes #15768
TypeScript Version:
0 2.3.1-insiders.20170416 (Playground)
Code
Expected behavior:
No error
Actual behavior:
Type 'I' cannot be used to index type '["a"]'.
I thought this may have worked before. Potential regression?
The text was updated successfully, but these errors were encountered: