There is a problem with the binary:part type spec used by dialyzer (the function is a BIF), such that it thinks the Length is pos_integer() instead of integer(). A similar problem exists within the documentation here (with the Length type): http://www.erlang.org/doc/man/binary.html#part-3