-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
dialyzer: Fix bug in bind_checked_inf/4 #6588
dialyzer: Fix bug in bind_checked_inf/4 #6588
Conversation
CT Test Results 5 files 137 suites 42m 23s ⏱️ For more details on these failures, see this check. Results for commit 0c59cb0. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Fair point about the name of the |
I thought about that and it didn't feel right to have "two" bottom types, but I'll happily change it if that's what everyone else prefers. Edit: to elaborate, the lattice can only have one bottom type, so if I saw |
27c1c63
to
4921ae8
Compare
`unit` can't be bound any more than `none` can. This resulted in slightly improved analysis in some cases, taking notice of more functions in OTP that lacked a local return, so I've added specs to those functions in order to silence the warnings. The pattern for that is: ```erlang try function_that_returns_unit() catch _:_ -> error(xyz) end ``` Previously, this expression was treated as returning unit() even though it could only ever return none(), as the wrapped function would never return.
Calling this function t_is_none_or_unit/1 is like saying t_is_integer_or_float/1 instead of t_is_number/1. I wouldn't be the least bit surprised if this weird naming was the root cause of erlangGH-6580.
4921ae8
to
0c59cb0
Compare
?unit
can't be bound any more than?none
can.While we're at it, rename
t_is_none_or_unit/1
tot_is_impossible/1
because the former is as silly as sayingt_is_integer_or_float/1
instead oft_is_number/1
.Fixes #6580