Skip to content

infer in docs in 2.8 release notes #34684

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

Closed
guyellis opened this issue Oct 23, 2019 · 3 comments
Closed

infer in docs in 2.8 release notes #34684

guyellis opened this issue Oct 23, 2019 · 3 comments
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@guyellis
Copy link

TypeScript Version: 3.6.4

Docs

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html

About half way through the above release-notes:

type Bar<T> = T extends { a: (x: infer U) => void, b: (x: infer U) => void } ? U : never;
type T20 = Bar<{ a: (x: string) => void, b: (x: string) => void }>;  // string
type T21 = Bar<{ a: (x: string) => void, b: (x: number) => void }>;  // string & number

T21 is never with tsc 3.6.4 but with 2.8 it is string & number. Would be great if that doc had a link to the updated functionality or noted that it's changed.

@RyanCavanaugh
Copy link
Member

I think it would be weird to backport changes to release notes - these are effectively historical documents and should be kept as-is absent concrete errors.

@RyanCavanaugh RyanCavanaugh added the Working as Intended The behavior described is the intended behavior; this is not a bug label Oct 23, 2019
@guyellis
Copy link
Author

@RyanCavanaugh - I understand and agree with the sentiment. Perhaps there's a better way to solve this. Is that information accurately available elsewhere in the official docs for the latest release of TypeScript? If so, how do we get readers from there to the latest docs or at least let them know that there could be changes since that was written and where these docs are?

For example, for this change, I can't find where this change is documented?

@typescript-bot
Copy link
Collaborator

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

3 participants