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

First round of Dialyzer fixes. #885

Merged
merged 44 commits into from
Apr 7, 2014
Merged

First round of Dialyzer fixes. #885

merged 44 commits into from
Apr 7, 2014

Conversation

cmeiklejohn
Copy link
Contributor

Resolves:

riak_kv_stat.erl:63: Expression produces a value of type [any()], but this value is unmatched
riak_kv_stat.erl:65: Expression produces a value of type ['ok' | {'error',_,'metric_already_exists' | 'nonexistent_metric' | 'unsupported_metric_type'}], but this value is unmatched
Be explicit on match for success and crash if unsuccessful.

Resolves:

riak_kv_stat.erl:172: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:176: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:184: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:185: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:188: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:192: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:195: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:199: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:202: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:203: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:207: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:208: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:209: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:210: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:215: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:216: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:221: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:222: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:223: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:224: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:228: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:229: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:234: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:235: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:239: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:256: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:259: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:260: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:266: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:267: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:303: Expression produces a value of type ['ok' | {'error',_,'unsupported_metric_type'}], but this value is unmatched
riak_kv_stat.erl:318: Expression produces a value of type ['ok' | {'error',_,'unsupported_metric_type'}], but this value is unmatched
riak_kv_stat.erl:338: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:348: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
Resolves:

riak_kv_stat.erl:309: Expression produces a value of type 'ok' | {'error',_,'metric_already_exists' | 'unsupported_metric_type'}, but this value is unmatched
Resolves:

riak_kv_stat.erl:489: Expression produces a value of type 'ok' | {'error',_,'metric_already_exists' | 'unsupported_metric_type'}, but this value is unmatched
Resolves:

riak_kv_stat.erl:325: Expression produces a value of type [any()], but this value is unmatched
Resolves:

riak_kv_stat.erl:577: Expression produces a value of type 'ok' | ['ok' | {'error',_,'metric_already_exists' | 'nonexistent_metric' | 'unsupported_metric_type'}], but this value is unmatched
Resolves:

riak_kv_stat.erl:324: Expression produces a value of type 'ok' | {'error',_,'metric_already_exists' | 'unsupported_metric_type'}, but this value is unmatched
Resolves:

riak_kv_stat.erl:310: Expression produces a value of type [any()], but this value is unmatched
Resolves:

riak_kv_stat.erl:256: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
riak_kv_stat.erl:288: Expression produces a value of type 'ok' | {'error',_,'unsupported_metric_type'}, but this value is unmatched
Resolves:

riak_kv_console.erl:320: Expression produces a value of type ['ok'], but this value is unmatched
riak_kv_console.erl:336: Expression produces a value of type ['ok'], but this value is unmatched
riak_kv_console.erl:349: Expression produces a value of type ['ok'], but this value is unmatched
riak_kv_console.erl:643: Expression produces a value of type 'ok' | ['ok'], but this value is unmatched
Even though legacy_gossip still exists, the code path is hardcoded to
false, so ignore dialyzer figuring out these sections of code will never
be reached.

Resolves:

riak_kv_console.erl:152: The pattern {'error', 'legacy_mode'} can never match the type {'error','is_up' | 'not_member' | 'only_member'}
Resolves:

riak_kv_console.erl:219: Expression produces a value of type 'ok' | {'error',_}, but this value is unmatched
Resolves:

riak_kv_console.erl:285: Expression produces a value of type [['ok']], but this value is unmatched
riak_kv_console.erl:227: Expression produces a value of type 'nop' | 'ok' | {'error',_}, but this value is unmatched
Resolves:

riak_kv_console.erl:299: Expression produces a value of type {'error','badfile' | 'native_code' | 'nofile' | 'not_purged' | 'on_load' | 'sticky_directory'} | {'module',atom() | tuple()}, but this value is unmatched
Resolves:

riak_kv_wm_keylist.erl:259: Expression produces a value of type {_,'ok'}, but this value is unmatched
Resolves:

riak_kv_wm_crdt.erl:390: Expression produces a value of type [any()], but this value is unmatched
Pipe is not using the R15+ style callbacks yet, so ignore warnings.
Resolves:

riak_kv_mrc_pipe.erl:287: Expression produces a value of type 'ok' | {'error','not_found' | 'simple_one_for_one'}, but this value is unmatched
riak_kv_mrc_pipe.erl:876: Expression produces a value of type 'ok' | {'error','not_found' | 'simple_one_for_one'}, but this value is unmatched
Resolves:

riak_kv_mrc_pipe.erl:1020: Expression produces a value of type [any()], but this value is unmatched
riak_kv_mrc_pipe.erl:1024: Expression produces a value of type [any()], but this value is unmatched
Resolves:

riak_kv_mrc_pipe.erl:1070: Expression produces a value of type ['ok' | {'error','sink_died' | 'timeout' | [any()]}], but this value is unmatched
Resolves:

riak_kv_pipe_index.erl:88: Expression produces a value of type {_,'ok'}, but this value is unmatched
Resolves:

riak_client.erl:790: Expression produces a value of type {_,'ok'}, but this value is unmatched
@cmeiklejohn cmeiklejohn added this to the 2.0-RC milestone Mar 29, 2014
Resolves:

riak_kv_pb_crdt.erl:136: Expression produces a value of type [any()], but this value is unmatched
Resolves:

riak_kv_mrc_sink.erl:331: Expression produces a value of type [any()], but this value is unmatched
Resolves:

riak_kv_index_fsm.erl:127: Expression produces a value of type {_,'ok'}, but this value is unmatched
riak_kv_index_fsm.erl:134: Expression produces a value of type {_,'ok'}, but this value is unmatched
riak_kv_index_fsm.erl:191: Expression produces a value of type {_,'ok'}, but this value is unmatched
riak_kv_keys_fsm.erl:104: Expression produces a value of type {_,'ok'}, but this value is unmatched
riak_kv_pb_bucket.erl:129: Expression produces a value of type {_,'ok'}, but this value is unmatched
riak_kv_pb_bucket.erl:136: Expression produces a value of type {_,'ok'}, but this value is unmatched
riak_kv_pipe_listkeys.erl:102: Expression produces a value of type {_,'ok'}, but this value is unmatched
Resolves:

riak_kv_entropy_manager.erl:218: Expression produces a value of type [any()], but this value is unmatched
riak_kv_entropy_manager.erl:262: Expression produces a value of type ['ok'], but this value is unmatched
riak_kv_entropy_manager.erl:395: Expression produces a value of type ['ok'], but this value is unmatched
riak_kv_entropy_manager.erl:502: Expression produces a value of type ['ok'], but this value is unmatched
Resolves:

riak_kv_index_hashtree.erl:849: Expression produces a value of type [hashtree:hashtree()], but this value is unmatched
Resolves:

riak_kv_index_hashtree.erl:589: Expression produces a value of type hashtree:hashtree(), but this value is unmatched
riak_kv_index_hashtree.erl:590: Expression produces a value of type hashtree:hashtree(), but this value is unmatched
Resolves:

riak_kv_index_hashtree.erl:279: Expression produces a value of type hashtree:hashtree(), but this value is unmatched
Resolves:

riak_kv_index_hashtree.erl:814: Expression produces a value of type 'ok' | hashtree:hashtree(), but this value is unmatched
Resolves:

riak_kv_index_hashtree.erl:517: Invalid type specification for function riak_kv_index_hashtree:index_2i_n/0. The success typing is () -> {0,0}
Given that riak_core does not yet provide > R15B callback information
for the coverage_fsm, ignore the warning for now.
Resolves:

riak_kv_buckets_fsm.erl:80: Expression produces a value of type 'ok' | {non_neg_integer(),'done' | {'buckets',[any()]} | {'buckets_stream',[any()]} | {'error',_}}, but this value is unmatched
riak_kv_buckets_fsm.erl:98: Expression produces a value of type {non_neg_integer(),'done' | {'buckets',[any()]} | {'buckets_stream',[any()]} | {'error',_}}, but this value is unmatched
riak_kv_buckets_fsm.erl:102: Expression produces a value of type {non_neg_integer(),'done' | {'buckets',[any()]} | {'buckets_stream',[any()]} | {'error',_}}, but this value is unmatched
riak_kv_buckets_fsm.erl:108: Expression produces a value of type {non_neg_integer(),'done' | {'buckets',[any()]} | {'buckets_stream',[any()]} | {'error',_}}, but this value is unmatched
Again, riak_core doesn't have > R15B supported callback info.  Ignore
for now.
Resolves:

riak_kv_multi_backend.erl:208: Expression produces a value of type [any()], but this value is unmatched
riak_kv_multi_backend.erl:354: Expression produces a value of type [any()], but this value is unmatched
Ignore for now, until we convert everything over to use the > R15B
behavior.
@seancribbs seancribbs self-assigned this Apr 4, 2014
@seancribbs
Copy link
Contributor

Except for my concerns about hashtree which should be addressed to core, 👍 on this. Good work.

@cmeiklejohn
Copy link
Contributor Author

Merging.

cmeiklejohn added a commit that referenced this pull request Apr 7, 2014
@cmeiklejohn cmeiklejohn merged commit d2c0dc9 into develop Apr 7, 2014
@cmeiklejohn cmeiklejohn deleted the bugfix/csm/dialyzer branch April 7, 2014 16:21
@seancribbs seancribbs removed their assignment May 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants