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

Improve dialyzer types and checking #369

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

dhull
Copy link

@dhull dhull commented Jan 30, 2018

This pull request has three commits.

The first changes the specs for some riak_pb_socket to allow an atom (for a registered name) as an alternative to passing the pid.

The second and third are to get rid of the warnings produced by "make lint". In the second, some values that were declared as string were copied to record fields that were declared to accept only binary; I added a iolist_to_binary conversion to silence that warning. In the third, some code is testing for an undefined value for record fields that are declared to not allow undefined; I diabled dialyzer's no_match warning for that function.

David Hull added 3 commits January 30, 2018 18:04
Many of the functions defined in riakc_pb_socket have specs that say
they take a pid(), but they in fact just pass this argument to
gen_server:call so they can take any ServerName argument that
gen_server:call accepts.
The #state.credentials field is declared as {User::string(),
Password::string()} but the rpbauthreq record's user and password
fields are declared as binary.  Call iolist_to_binary to convert.
Dialzyer produces errors such as the following because the code checks
for fields containing `undefined` when the spec does not allow it.

riakc_pb_socket.erl:1786: The pattern 'undefined' can never match the type [binary()]
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.

1 participant