Attention is currently required from: pespin.
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38297?usp=email )
Change subject: s1gw_metrics: more precise type hints ......................................................................
Patch Set 2:
(1 comment)
File src/s1gw_metrics.erl:
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38297/comment/04631954_782fe... : PS2, Line 85: -type counter() :: [ctr | _].
can you explain this to me? it kind of matches tokens starting with ctr?
Yes, exactly. It's basically the usual `[Head | Tail]` form, letting dialyzer know that the `Head` shall be `ctr` for counters and `gauge` for gauges. Try this in erlang shell:
```erlang 6> [ctr | _] = [ctr, 1, 2, 3]. [ctr,1,2,3] 7> [ctr | _] = [gauge, 1, 2, 3]. ** exception error: no match of right hand side value [gauge,1,2,3] ```