-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Type inference issue related to usage of conditional type #25299
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
This'd likely be fixed by #17819 if we're still interested in it. The root issue is that the apparent constraint of |
Thanks. While being not critical this feature is still relevant to my use case. I'm not sure should this issue be closed now. Latest build available at npm is 3.1.0-dev.20180907 so I cannot verify fix currently. |
We haven't taken #17819 yet, so this issue should stay open. I just remarked that we already have a fix for another problem availablr that should also fix this. |
@RyanCavanaugh we need to revisit #17819 to fix this. |
TypeScript Version:
2.8.1, 2.9.2, 3.0.0-dev.20180628
Search Terms:
conditional type inference
Code
Expected behavior:
state parameter is infered to be "AppState" in the expression at the end
Actual behavior:
state parameter is infered to be "any"
Playground Link:
Playground
(use noImplicitAny flag)
Related Issues:
Not sure #25301
Workaround:
When Handler is defined as follows
it still allows to pass single argument handler and state is infered to be AppState
The text was updated successfully, but these errors were encountered: