Closed
Description
Elixir and Erlang/OTP versions
main
Operating system
MacOs
Current behavior
From phoenix_html
warning: incompatible types given to Phoenix.HTML.Safe.to_iodata/1:
Phoenix.HTML.Safe.to_iodata([60, "foo" | 62])
given types:
non_empty_list(binary() or integer(), integer())
but expected a type that implements the Phoenix.HTML.Safe protocol, it must be one of:
dynamic(%Date{} or %DateTime{} or %NaiveDateTime{} or %Time{} or %URI{}) or atom() or binary() or
float() or integer() or list(term()) or {...}
typing violation found at:
│
13 │ assert Safe.to_iodata([?<, "foo" | ?>]) == ["<", "foo" | ">"]
Expected behavior
We should probably consider implementing the List protocol as a maybe_improper_list
.
I have a tentative fix, will open a PR.