Skip to content
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

fix: infer unioned handles #8562

Merged
merged 1 commit into from Jun 24, 2022
Merged

fix: infer unioned handles #8562

merged 1 commit into from Jun 24, 2022

Conversation

jrandolf
Copy link
Contributor

Fixes: #8558

@jrandolf jrandolf requested a review from OrKoN June 23, 2022 22:08
@jrandolf jrandolf enabled auto-merge (squash) June 23, 2022 22:09
...args: EvaluateParams<Params>
): Promise<Awaited<ReturnType<Func>>> {
...args: Params
): // @ts-expect-error Circularity here is okay because we only need the return
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having test types would be nice at this point? does TS generate proper d.ts if there are some errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it still generates the types correctly. I assume this would break if the type is truly circular (meaning it returns this somehow). Regarding testing this, the test files that changed at the tests in some sense. The typing on the files that changed broke as soon as I implemented this, which makes sense because they were wrong before.

@jrandolf jrandolf merged commit 8100cbb into main Jun 24, 2022
@jrandolf jrandolf deleted the t branch June 24, 2022 06:40
@jrandolf jrandolf added this to the Puppeteer Type Improvements milestone Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Page#evaluate fails to assign types to function parameters
2 participants