Skip to content

Bad error message for to_binary [{}] #1144

@alco

Description

@alco

to_binary {} gives a proper error message

** (Protocol.UndefinedError) protocol Binary.Chars not implemented for {}

But if we pass it a list that contains non-printable terms, it shows something different:

iex(3)> to_binary [{}]
** (ArgumentError) argument error
    :erlang.iolist_to_binary([{}])
    /Users/alco/Documents/git/elixir/lib/elixir/lib/binary/chars.ex:61: Binary.Chars.List.to_binary/1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions