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 erronous void | null typing #171

Merged
merged 1 commit into from
Feb 24, 2025
Merged

Fix erronous void | null typing #171

merged 1 commit into from
Feb 24, 2025

Conversation

alexrudd2
Copy link
Owner

If I'm understanding this correctly, noConfusingVoidType actually caught some typing errors. The entire callback can be null, not just its return.

Leaving this as a PR, since I'm not sure if I understand it fully. Also, I'm curious if this has caused any actual problems, particularly with people reporting pause/unpause not working.

@juli4nb4dillo
Copy link
Collaborator

This tracks, it doesn't make sense to return either void or null, so precedence should go to function or null. Let me test real quick.

Copy link
Collaborator

@juli4nb4dillo juli4nb4dillo left a comment

Choose a reason for hiding this comment

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

Works for me. the bug is legitimate, precedence goes to the pipe operator, hence () => void | null; actually means a "function that returns void or null", and it should be "a function or null"

@alexrudd2
Copy link
Owner Author

alexrudd2 commented Feb 24, 2025

Thanks!

I should keep this in mind when we try debugging the pause issues.

@alexrudd2 alexrudd2 merged commit d804244 into main Feb 24, 2025
6 checks passed
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.

2 participants