-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Regression in Type Inference engine in TypeScript 2.7.1 #22376
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
Looks like a change in inference priority - @ahejlsberg any thoughts? |
Adding @sandersn. Looks like it is caused by #21271. We now infer from |
Fixed in #22525 |
* Combine keyof T inferences * Extract covariant inference derivation into function * Test:keyof inference lower priority than return inference for #22376 * Update 'expected' comment in keyofInferenceLowerPriorityThanReturn * Update comment in test too, not just baselines * Fix typo * Move tests
* Combine keyof T inferences * Extract covariant inference derivation into function * Test:keyof inference lower priority than return inference for #22376 * Update 'expected' comment in keyofInferenceLowerPriorityThanReturn * Update comment in test too, not just baselines * Fix typo * Move tests
The following code works great in these TypeScript versions:
But it gives a compile error in these TypeScript versions:
BugTest.ts
Manually adding the type argument allows the compile to succeed:
The text was updated successfully, but these errors were encountered: