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 unmatched return errors #24

Closed
norton opened this issue Apr 12, 2011 · 3 comments
Closed

dialyzer unmatched return errors #24

norton opened this issue Apr 12, 2011 · 3 comments

Comments

@norton
Copy link
Contributor

norton commented Apr 12, 2011

Using dialyzer's unmatched return analysis, the following dialyzer errors are reported for meck.

meck.erl:77: Expression produces a value of type ['ok'], but this value is unmatched
meck.erl:103: Expression produces a value of type ['ok'], but this value is unmatched
meck.erl:121: Expression produces a value of type ['ok'], but this value is unmatched
meck.erl:138: Expression produces a value of type ['ok'], but this value is unmatched
meck.erl:153: Expression produces a value of type ['ok'], but this value is unmatched
meck.erl:220: Expression produces a value of type ['ok'], but this value is unmatched
meck.erl:496: Expression produces a value of type 'ok' | {'error',atom()}, but this value is unmatched

@eproxus
Copy link
Owner

eproxus commented Apr 12, 2011

The fix would be to do this:

[ok = new(M) || M <- Mod], ok.

However, that still generates the same warning in dialyzer. I've emailed the mailing list reporting it as a false positive. Will look into it more once I get a reply.

@norton
Copy link
Contributor Author

norton commented Apr 12, 2011

Ok. If you have time, please try the following ...

lists:foreach(fun(M) -> ok = new(M) end, Mod), ok.

@eproxus
Copy link
Owner

eproxus commented Apr 12, 2011

I already did and it removed the warnings. I'm skipping matching on ok though, because the functions only return ok anyways and will throw exceptions if something goes wrong.

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