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
conditional type guard
This seems to not be a regression at all.
Playground link with relevant code
type X<T> = A<T> | B<T> type A<T> = {type: "a", value: T} type B<T> = {type: "b", value: T} type R<T,Y extends X<T>> = Y extends B<T> ? T : void function f<T,Y extends X<T>>(y: Y): R<T,Y> { if (y.type === "b") { return y.value } else return }
TS complains about y.value and else return.
y.value
else return
They should be accepted.
The text was updated successfully, but these errors were encountered:
Duplicate of #33912
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Bug Report
π Search Terms
conditional type guard
π Version & Regression Information
This seems to not be a regression at all.
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
TS complains about
y.value
andelse return
.π Expected behavior
They should be accepted.
The text was updated successfully, but these errors were encountered: