-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Unable to narrow parameterized generic types for functions #25039
Comments
With Without |
I think I communicated the issue confusingly, it was not about the actual return type but the type guard in the implementation, I edited the first post to reflect that. |
Duplicate of #13995 |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
TypeScript Version: 2.8
Code
Expected behavior:
z1
andz2
should have the same type, which isa
Actual behavior:
function test
is unable to narrow parameter x, with the if check, andz2
resolves tox
The text was updated successfully, but these errors were encountered: