Skip to content

Problem with spec of function match datapoints #133

@mmzeeman

Description

@mmzeeman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions