You might not be wrong about this function, it just isn’t super obvious to me that Dialyzer is right either. Either way, check out this line: plug/lib/plug/conn/query.ex at 274e44f9a149b922099bf60029d8267afe494968 · elixir-plug/plug · GitHub
The encode_pair function is a defp and the output of that function is passed immediately to IO.iodata_to_binary. iodata is one of the real world uses for improper lists, because it reduces the overhead of building out a list front to back. The iodata_to_binary is able to handle improper lists and turn them into a single binary.
Dialyzer warns about improper lists because most of the time you do indeed want to warn for them. If the Plug core team used dialyzer they would probably put a no-warn invocation in there to tell dialyzer that this is intentional.






















