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

Prevent throwing a division by zero when encountering a literal division by zero #5182

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

orklah
Copy link
Collaborator

@orklah orklah commented Feb 9, 2021

This should fix #5157. When there is a literal 1/0 in code (for example in tests). Psalm attempt to calculate the result of the division and throw an error.

I used the TEmpty type for this but I'm not sure I should have

@muglug muglug merged commit 88fe805 into vimeo:master Feb 9, 2021
@muglug
Copy link
Collaborator

muglug commented Feb 9, 2021

Thanks – I sort of don't get why anyone would be this dumb, but I guess?

@orklah
Copy link
Collaborator Author

orklah commented Feb 9, 2021

Well, this was on purpose. According to the author of the issue, it was made for triggering an unexpected error in tests

@orklah orklah deleted the avoid-div-by-zero branch September 14, 2021 17:39
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.

Untrapped Divide by Zero Error
2 participants