Closed shun159 closed 9 years ago
@shun159 thanks!
And "nibble(unsigned_int 0..16#f)" type name is ambiguous.
Is that a dialyzer error or is the type itself ambiguous? If so, what do you suggest?
Thanks again for catching this!
If against your will, I'm sorry.
this is not a relevant to dialyzer. this issue is related to the naming of the type. The intent of this issue is, recommented to use other words instead of such a unit like "nibble", "byte" and "short" .
for example:
-type bit() :: 0 .. 1.
-type in_port_t() :: 0 .. 16#ffff.
% -type nibble() :: 0 .. 2#1111. added pkt:bit4() instead of pkt:nibble()
-type bit4() :: 0..2#1111.
% added pkt:uint8_t instead of byte()
-type uint8_t() :: 0..16#ff.
-type uint16_t() :: 0 .. 16#ffff.
-type uint32_t() :: 0 .. 16#ffffffff.
-type in_addr() :: {uint8_t() ,uint8_t() ,uint8_t() ,uint8_t() }. % use uint8_t() instead of byte().
-type in6_addr() :: {uint16_t(),uint16_t(),uint16_t(),uint16_t(),uint16_t(),uint16_t(),uint16_t(),uint16_t()}.
sorry for my poor English. Regards.
Much cleaner! Thanks for the feedback!
:+1:
Hi @msantos
https://github.com/msantos/pkt/blob/master/src/pkt.erl#L73
I think "0 .. 16#ff." is should uint8_t. And "nibble(unsigned_int 0..16#f)" type name is ambiguous.
Sorry for my broken English
regards.