-
Notifications
You must be signed in to change notification settings - Fork 12.8k
[Regression] ReturnType<> Inference works on 3.3.3, breaks on 3.4.1, 3.5.1 #31814
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 is a simplified repro. My actual use case is more complicated in that So, the repro might not make much sense here =x |
@ahejlsberg looks like another instance of contextual return type inference messing things up, though it's not completely obvious how in this example |
This is an effect of #30215 and I'm not sure there's much we can do to change it. With #30215 we sometimes defer processing of arguments in order to make better inferences (but we didn't before 3.4.1). This is captured here in my comment in
In the |
TypeScript Version: 3.4.1, 3.5.1
Search Terms: regression, ReturnType, parameter, inference
Code
Expected behavior:
The below should work,
Actual behavior:
It used to work but does not work now.
Playground Link: Playground
Related Issues:
I feel like it is related to #29133 somehow. Because I have
ReturnType<>
being used in a parameter again. But it's somewhat different this time in that the first argument is not an anonymous function "literal" I created. It's a function given by another function.The text was updated successfully, but these errors were encountered: