Closed Menkir closed 2 years ago
This isn't causing a compile warning for me - what warning are you seeing?
My understanding is that the type spec you describe {update, field(), crdt_op()}
is as as defined for map_field_update
, the type of an individual map update.
The map_op
perhaps should be pluralised, as it is a list of these updates (i.e. map_op
is the container for the Ops referred to in the doc string, where the map_field_update
is a potential type for an individual Op).
i.e. map_op
is the type of "Ops", and each Op can be type map_field_update
or map_field_op
.
It isn't necessarily a mistake that the type map_op
, which refers to multiple Ops, is not pluralised. As all the Ops in the list will be applied in one operation - so it is a singular "Op" which contains multiple "Ops".
Just to be clear, I do get this compile warning:
... riak_dt/_build/default/lib/riak_dt/ebin/riak_dt.app" is missing description entry
- but this isn't related, and I will fix this later today.
Ok i think i as on the wrong track. My Projekt uses an older fork where the type specs are still wrong. @martinsumner even fixed that three years ago: https://github.com/basho/riak_dt/commit/81d88764e4cc9acd66807fc8bbe1ded375fbe44e
But anyway thanks to @martinsumner !! :smile:
Hey Guys,
i recently took a look into the type spec of
riak_dt_map
and found something strange.According to the
riak_dt_map.update/3
function the first parameterOp
is defined asmap_op()
:riak_dt_map.erl
The
field()
type is resolved to:So field is basically a tuple of two tuples etc.
But in
riak_dt_map.update/3
docs there is the following explanation:{update, field_name(), Op}
is not the correct type spec ofmap_op()
, its{update, field(), crdt_op()}
.This causes a compile warning.