-
Notifications
You must be signed in to change notification settings - Fork 233
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
Conversation
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-programemd with @reiddraper
Pair-programmed with @reiddraper
Pair-programmed with @reiddraper
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
Pair-programmed with @reiddraper
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.
Blah, made a mistake in a commit. I'll be force-pushing here shortly. |
@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
Sure. Do you want me to go back and amend the commits? Or just going forward? |
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. |
Just going forward is fine. I'll take the review of this now. |
Left some comments, 👍 otherwise. |
@cmeiklejohn have all of the review comments been handled? If so, ready to merge? |
Merge away. |
Some small dialyzer progress
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.