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

Problem with spec of function match datapoints #133

Open
mmzeeman opened this issue Jan 13, 2021 · 0 comments
Open

Problem with spec of function match datapoints #133

mmzeeman opened this issue Jan 13, 2021 · 0 comments

Comments

@mmzeeman
Copy link

There is a problem with the match spec when registering a datapoint like this:

ok = exometer:new([erlang, gc],
    {function, erlang, statistics, [garbage_collection], match, {total_coll, rec_wrd, '_'}})

Dialyzer Error

 289: The call exometer:new(['erlang', 'gc'], {'function', 'erlang', 'statistics', ['garbage_collection'], 'match', {'total_coll', 'rec_wrd', '_'}}) will never return since the success typing is ([any()], atom() | {atom(),_} | {'function',atom(),atom()} | {'function',atom(),atom(),[any()],atom(),[any()]}) -> 'ok' and the contract is (name(), type()) -> 'ok'

Dialyzer flags this as a type error because the datapoints() in match expressions is defined as a list. But for match expressions it is defined in the documentation that this should be a match expression. See: https://github.com/Feuerlabs/exometer_core/blob/master/doc/exometer_function.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant