-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Incorrect overload is used for composed function inside pipe
#25637
Comments
Hi, I have a similar problem:
|
Hey @mhegazy, any idea if this is a bug or design limitation? Hopefully my examples demonstrate the frequency of this issue. |
In @dardino's example the overloads do not include the implementation signature, so there is no overload that accepts |
In the OP: |
I simplified the |
@mhegazy Sure, but i think this is a bit limiting thing.
I believe that is possible to make this assumption:
|
@dardino This issue is concerning overloads when used with a |
ok |
pipe
Looks like a duplicate of #10957 |
Ref DefinitelyTyped/DefinitelyTyped#28592 which seems to have been motivated by this. |
Revisiting this. This isn't specific to generic composed functions. I believe the issue can be narrowed down to:
Any ideas @weswigham? Does this help? |
pipe
pipe
pipe
pipe
pipe
pipe
This is definitely #10957 - overloads aren't considered during generic inference |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
5 similar comments
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
You may rest now bot. |
TypeScript Version: 2.9.2
Search Terms: generic function pipe contextual type wrong overload
Code
These examples are stripped down versions of Node's
parse
function in thequerystring
module and Lodash'svalues
andfromPairs
functions.These are issues we ran into when trying to use these functions with a
pipe
function.The text was updated successfully, but these errors were encountered: