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
Type of array elements shouldn't affect type inference in this case.
TypeScript Version: 3.7.x-dev.20200115
Search Terms:
Code
([] as any[]).reduce(() => 0, 0); // any ([] as unknown[]).reduce(() => 0, 0); // unknown ([] as never[]).reduce(() => 0, 0); // number
Expected behavior:
([] as any[]).reduce(() => 0, 0); // number ([] as unknown[]).reduce(() => 0, 0); // number ([] as never[]).reduce(() => 0, 0); // never or number
Actual behavior:
Playground Link: https://www.typescriptlang.org/play/?target=99&ts=3.8.0-dev.20200115&ssl=1&ssc=1&pln=3&pc=46#code/BQbQugBAhgztB2BPcBKAdAJwKYBMCuAxlsMChALwB8EADADS0oDcEA9KwogFCiSwR54Aa3gB7AO7xUmXIWKkK1eoxbsBwsZJ7hoceFgBuWDNOz4iJMlVoMazNh3h4AtgCNjQA
Related Issues: #25454
The text was updated successfully, but these errors were encountered:
Please add to our suite at #36554
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Type of array elements shouldn't affect type inference in this case.
TypeScript Version: 3.7.x-dev.20200115
Search Terms:
Code
Expected behavior:
Actual behavior:
Playground Link: https://www.typescriptlang.org/play/?target=99&ts=3.8.0-dev.20200115&ssl=1&ssc=1&pln=3&pc=46#code/BQbQugBAhgztB2BPcBKAdAJwKYBMCuAxlsMChALwB8EADADS0oDcEA9KwogFCiSwR54Aa3gB7AO7xUmXIWKkK1eoxbsBwsZJ7hoceFgBuWDNOz4iJMlVoMazNh3h4AtgCNjQA
Related Issues: #25454
The text was updated successfully, but these errors were encountered: