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

Some small dialyzer progress #904

Merged
merged 20 commits into from
Apr 16, 2014
Merged

Some small dialyzer progress #904

merged 20 commits into from
Apr 16, 2014

Conversation

reiddraper
Copy link
Contributor

There are still tons of dialyzer errors not fixed by this PR, but I figured it was better to merge things early, particularly since the commits are not related to each-other. I'll add some comments if I think there are commits that need extra review by the original author.

Vagabond and others added 18 commits April 11, 2014 15:19
Pair-programmed with @reiddraper

bitcask:delete only ever returns `ok`.
Pair-programmed with @reiddraper

Dialyzer found a bug with this function, and it appears to be completely unused
in Riak. It was introduced in 39343fa. In the creation of the record, ref is
set to undefined, which will crash the underlying call to Bitcask when it tries
to grab information of of the process dictionary.
Pair-programmed with @reiddraper

Dialyzer was treating the fields of the KV_INDEX_Q that were of the same
type as continuation() as opaque and getting mad about record
construction.
Pair-programmed with @reiddraper

Use the eleveldb:db_ref() type instead of assuming it's a reference()
type.
Pair-programmed with @reiddraper

We create a magic value with {0, 0} as the value, so the type spec must
account for this.
Pair-programmed with @reiddraper

There is commented code from consistent_put that talks about adding this
in the future, so we put a comment on the receiving end of this function
saying the same.
Pair-programmed with @reiddraper

Dialyzer caught that the bucket will always be a binary, so there is no
need to convert it. Hopefully there is no data on disk that uses atoms
for buckets...
Pair-programmed with @reiddraper

* Change the expected type of allow_mult
* Change the error reason type to allow strings
Pair-programmed with @reiddraper

Previously we were pattern matching a two-tuple where the value returned
was a proplist. This change now treats the value correctly as a
proplist. Note, this is still an issue in 1.4, since this was
forward-ported from the 1.4 series.
Pair-programmed with @reiddraper

The accumulator used internally in merge_contents is a three-tuple, not
a two-tuple.
Pair-programmed with @reiddraper

* db_ref is an opaque type, we don't know it's a reference
* dialyzer claims the last clause of fold_keys_fun is completely
  subsumed by the previous clauses. If it's not, we'll throw an
  exception either way with a bad match.
Pair-programmed with @reiddraper

The caller of this function handles the case where the result of
Module:Function does not return a list, so the type spec should reflect
that
riak_kv_entropy_info:handle_index_info is not exported. It was being
called once internally, with an argument that was ignored in its
implementation. This commit simply removes that argument.
update_hashtree is called with both binaries and riak objects.
@reiddraper
Copy link
Contributor Author

Blah, made a mistake in a commit. I'll be force-pushing here shortly.

@seancribbs
Copy link
Contributor

@reiddraper where possible could you also include the warnings fixed by each commit? @cmeiklejohn and I started doing that so it's more clear.

diff_index_specs clearly accepts 'undefined' as an argument because it
calls index_data, which pattern matches on undefined in its definition.
Fixes the return value of riak_object:from_binary
@reiddraper
Copy link
Contributor Author

@reiddraper where possible could you also include the warnings fixed by each commit? @cmeiklejohn and I started doing that so it's more clear.

Sure. Do you want me to go back and amend the commits? Or just going forward?

@reiddraper
Copy link
Contributor Author

I think if/once this is merged, I'll file separate issues for dialyzer work on the remaining modules, which, at first glance, required more domain expertise.

@cmeiklejohn cmeiklejohn self-assigned this Apr 15, 2014
@cmeiklejohn
Copy link
Contributor

Just going forward is fine. I'll take the review of this now.

@cmeiklejohn
Copy link
Contributor

Left some comments, 👍 otherwise.

@reiddraper
Copy link
Contributor Author

@cmeiklejohn have all of the review comments been handled? If so, ready to merge?

@cmeiklejohn
Copy link
Contributor

Merge away.

reiddraper added a commit that referenced this pull request Apr 16, 2014
@reiddraper reiddraper merged commit baa2941 into develop Apr 16, 2014
@reiddraper reiddraper deleted the feature/dialyzer-fixin branch April 16, 2014 14:58
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.

5 participants