-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Change else clause to never in ReturnType #44669
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
type SomeType = string
// Type 'string' does not satisfy the constraint '(...args: any) => any'.(2344)
let foo: ReturnType<SomeType>
// Property 'toLowerCase' does not exist on type 'never'.
foo.toLowerCase() |
I don't believe this is noise but your statement makes sense. |
I don't really see the purpose of this change. The only benefit you have is receiving Additionally I think |
I was really convinced. |
lib Update Request
Configuration Check
My compilation target is
es5
and my lib isthe default
.Missing / Incorrect Definition
The else clause of ReturnType is never reached because of the constraint so that it is reasonable to be never.
Sample Code
Documentation Link
https://www.typescriptlang.org/docs/handbook/utility-types.html#returntypetype
Changeset
I already made a changeset. I didn't know that a backlog issue is required to open a pull request.
https://github.com/microsoft/TypeScript/compare/main...umireon:returntype-never?expand=1
Duplicates
A possible duplicate is #39584 but nothing is discussed there.
The text was updated successfully, but these errors were encountered: