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

dialyzer warnings with meck (73c0b3e) #58

Closed
norton opened this issue Mar 11, 2012 · 2 comments
Closed

dialyzer warnings with meck (73c0b3e) #58

norton opened this issue Mar 11, 2012 · 2 comments

Comments

@norton
Copy link
Contributor

norton commented Mar 11, 2012

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 <Mod, Func, Args, [Meck = {'meck', 'exec', Arity} | Stack]> can never match the type <atom(),,_,[{atom(),atom(),[any()] | byte(),[any()]},...]>
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
Copy link
Owner

eproxus commented Mar 11, 2012

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
Copy link
Contributor Author

norton commented Mar 12, 2012

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
Projects
None yet
Development

No branches or pull requests

2 participants