8000 Can't pass the return value of a callback with known type to another function that should accept that kind of type. · Issue #49603 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content

Can't pass the return value of a callback with known type to another function that should accept that kind of type. #49603

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

Closed
paoloricciuti opened this issue Jun 19, 2022 · 6 comments
Labels
Duplicate An existing issue was already created

Comments

@paoloricciuti
Copy link

Given this situation in the Playground i should be able to pass the return value of the callback in cssFunction as the style value for the call to domFunction but typescript yells at me that is not assignable.

Is this a valid bug or is this expected behavior?

@paoloricciuti paoloricciuti added the Duplicate An existing issue was already created label Jun 19, 2022
@jcalz
Copy link
Contributor
jcalz commented Jun 19, 2022

Issues like this tend to be closed as "unactionable" with the comment:

To expedite the triage process, we need everyone to follow the issue template and instructions.

When you clicked "Create New Issue", the issue form was pre-populated with a template and some instructions. We need you to read those instructions completely, follow them, and then fill in all the fields in that template.

We are not able to assist with issues that don't follow the template instructions as they represent a significantly larger amount of work compared to issues which are correctly specified. Thank you for understanding.

If you want to avoid this fate you should probably edit the issue now with the requisite information. And maybe remove the "Duplicate" label too.

Sorry, something went wrong.

@fatcerberus
Copy link
fatcerberus commented Jun 19, 2022

@jcalz Looks like they used the bug template for #9998 dupes, which leaves out the usual issue template and only includes comments that the behavior is by design (and auto-adds the “duplicate” label). This doesn’t seem to be related to 9998, though.

@RyanCavanaugh
Copy link
Member

I checked the code anyway and this is a correct error; it's not possible to construct a valid DOMUpdate<T> from an object expression inside a function generic on T - the code has a potential bug.

@paoloricciuti
Copy link
Author

Can I ask you why it's not possible? I'm trying to understand.

@paoloricciuti
Copy link
Author

Also if I try to just pass values it correctly give me intellisense and it doesn't errors out. It also does not errors out if I don't add the second generic to IFunction.

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants
0