Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

dialyzer warnings with meck (73c0b3e) #58

Closed
norton opened this Issue · 2 comments

2 participants

@norton

I noticed a few new dialyzer warnings.

[meck ((73c0b3e...))]$ dialyzer --version
Dialyzer version v2.5

[meck ((73c0b3e...))]$ dialyzer --plt ~/.dialyzer_plt.R15B -Wunmatched_returns --src src
Checking whether the PLT /Users/norton/.dialyzer_plt.R15B is up-to-date... yes
Proceeding with analysis...
meck.erl:356: Expression produces a value of type binary(), but this value is unmatched
meck.erl:521: Expression produces a value of type binary(), but this value is unmatched
meck.erl:653: The pattern can never match the type
meck_cover.erl:29: Expression produces a value of type 'ok' | binary(), but this value is unmatched
meck_cover.erl:30: Call to missing or unexported function cover:compile_beam/2
meck_cover.erl:93: Expression produces a value of type 'ok' | {'error',atom()}, but this value is unmatched
meck_cover.erl:97: Call to missing or unexported function cover:get_term/1
meck_cover.erl:104: Expression produces a value of type [any()], but this value is unmatched
meck_cover.erl:108: Call to missing or unexported function cover:write/2
done in 0m15.09s
done (warnings were emitted)

[meck ((73c0b3e...))]$ git log -n 1
commit 73c0b3e
Merge: 0e1b928 e84d4d0
Author: Adam Lindberg eproxus@gmail.com
Date: Fri Mar 9 17:00:14 2012 -0800

Merge pull request #57 from Erkan-Yilmaz/master

Remove repetition and typo in documentation
@eproxus eproxus closed this in 25592ab
@eproxus
Owner

Perfect bug report! The following warnings must remain for now. For R14 compatibility:

meck.erl:653: The pattern <Mod, Func, Args, [Meck = {'meck', 'exec', _Arity} | Stack]> can never match the type 
<atom(),_,_,[{atom(),atom(),[any()] | byte(),[any()]},...]>

These functions are exported by a hack in the code:

meck_cover.erl:30: Call to missing or unexported function cover:compile_beam/2
meck_cover.erl:98: Call to missing or unexported function cover:get_term/1
meck_cover.erl:109: Call to missing or unexported function cover:write/2
@norton

Thanks!

One suggestion for the warnings that must remain for now.

If it is practical and strait-forward to use a conditional define to enable and to disable certain blocks of code in meck, rebar supports defines based on the platform version. Sorry, I haven't checked the source code of meck.erl:653.

Here is one sample for old_inets:

https://github.com/norton/ubf-jsonrpc/blob/master/rebar.config#L15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.