Dialyzer Fixes #270

Merged
merged 6 commits into from Feb 26, 2013

Conversation

Projects
None yet
2 participants
Contributor

jrwest commented Feb 1, 2013

Addresses some warnings found in dialyzer mostly by correcting type specs. One dead code branch is removed. Complete list of warnings found on master (db17fcc): https://gist.github.com/176895ea43b1f41ea3c2. Notes about which warnings are fixed can be found in the commit messages.

Note: you will need a rebar that contains this commit in order to run dialyzer without crashing on riak_core_pb not being compiled with debug_info. I used basho/rebar master. This PR does not include a change to rebar (figured that could be done separately when we decide what version).

engelsanchez was assigned Feb 25, 2013

Contributor

engelsanchez commented Feb 26, 2013

I've gone over the changes and ran dializer myself. Everything looks super. My only note was that this will require a merge from master to reconcile the ring handler code. Other than that 👍 💃

jrwest was assigned Feb 26, 2013

jrwest added some commits Jan 31, 2013

@jrwest jrwest fix dialyzer warnings in vnode manager
addresses:
  L560: Function update_forwarding/3 has no local return
  L563: Record construction [...] violates the declared type of field forwarding::'undefined' | [pid()]
  L670: The pattern [{MI, Node} | _] can never match the type 'undefined' | [pid()]
  L672: The pattern [{MI, Node} | _] can never match the type 'undefined' | [{_,integer(),pid(),atom()}]
8e36b40
@jrwest jrwest fix dialyzer warnings in node watcher
addresses:
  L756: The created fun has no local return
  L757: The call erlang:apply(Mod::atom(),Func::atom(),nonempty_improper_list('undefined' | pid(),byte())) will
        never return since it differs in the 3rd argument from the success typing arguments:
        (atom() | tuple(),atom(),[any()])
  L757: Cons will produce an improper list since its 2nd argument is byte()
  L770: Function health_check_result/2 will never be called
fb4329a
@jrwest jrwest fix dialyzer warnings in handoff manager
addresses
  L163: The pattern [...] can never match the type {'error','max_concurrency'}
  L504: Record construction [...] violates the declared type of field mod_src_tgt::'undefined' | {atom() | tuple(),integer(),integer()}
8affa6a
@jrwest jrwest remove reference to riak_obect:bucket() type
it doesn't exist in core. fixes dialyzer warning about non-existent type
5b03fc8
@jrwest jrwest remove dead code block in ring handler (found via dialyzer)
riak_core:wait_for_application/1 has never returned anything besides ok
(it has no timeout) unlike its predecessor.

Code changed to remove timeout/error in this commit:
63334d3
9a2f351
@jrwest jrwest address some dialyzer warnings in riak_core_ring
addresses:
  L241: Record construction [...] violates the declared type of field vclock::'undefined' |
        vclock:vclock() and meta::'undefined' | dict()
  L305: Function fresh/0 has no local return
  L312: Function fresh/1 has no local return
  L318: Function fresh/2 has no local return
  L321: Record construction [...] violates the declared type of field nodename::atom() and
        clustername::'undefined' | {atom(),_} and members::'undefined' | [{atom(),{'down' |
        'exiting' | 'invalid' | 'joining' | 'leaving' | 'valid',vclock:vclock(),[]}}] and
        claimant::atom() and seen::'undefined' | [{atom(),vclock:vclock()}]
  L1013: Function reconcile_divergent/3 will never be called
  L1062: Function reconcile_next/2 will never be called
  L1075: Function reconcile_divergent_next/2 will never be called
  L1091: Function substitute/3 will never be called
  L1092: The created fun has no local return
  L1103: Function reconcile_ring/3 will never be called
  L1229: Function equal_cstate/2 has no local return
  L1232: Function equal_cstate/3 has no local return
  L1241: Record construction [...] violates the declared type of field
         vclock::'undefined' | vclock:vclock() and chring::'undefined' |
         {integer(),[{integer(),_}]} and meta::'undefined' | dict() and
         clustername::'undefined' | {atom(),_} and members::'undefined' | [{atom(),
         {'down' | 'exiting' | 'invalid' | 'joining' | 'leaving' | 'valid',vclock:vclock(),[]}}]
          and seen::'undefined' | [{atom(),vclock:vclock()}] and rvsn::'undefined' |
          vclock:vclock()

does not address:
  L240: Function nearly_equal/2 has no local return
  L430: Function reconcile/2 has no local return
  L965: Function internal_reconcile/2 has no local return
  L1014: Function reconcile_divergent/3 has no local return
  L1104: Function reconcile_ring/3 has no local return
  L1252: The pattern 'true' can never match the type 'false'
4bbaefd
Contributor

engelsanchez commented Feb 26, 2013

I just did a quick verify on the rebased branch. Ship it! 👍 💃

@jrwest jrwest added a commit that referenced this pull request Feb 26, 2013

@jrwest jrwest Merge pull request #270 from basho/jrw-dialyzer-fixes
Dialyzer Fixes
2f13622

@jrwest jrwest merged commit 2f13622 into master Feb 26, 2013

1 check passed

default The Travis build passed
Details

jrwest deleted the jrw-dialyzer-fixes branch Feb 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment