There is a mismatch between the typespec and the actual implementation of System.cmd/2.
Elixir & Erlang versions (elixir --version):
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.4.0
Operating system:
macOS 10.12.5
Calling System.cmd with a charlist argument compiles and runs successfully, but fails dialyzer typechecks, because the typespec doesn't include charlist options. The current typesped is: @spec cmd(binary, [binary], Keyword.t).
eg
System.cmd("ls", ['-la'])
I think the typespec should be changed to @spec cmd(binary, [binary | charlist], Keyword.t) .
Or
The implementation should not accept charlists.
The implementation should not accept charlists. A PR that adds a binary check would be appreciated.
Most helpful comment
The implementation should not accept charlists. A PR that adds a binary check would be appreciated.