Skip to content

Commit bd3b2f6

Browse files
authored
Fix dialyzer warning on IO.inspect :label (elixir-lang#14865)
1 parent 58c4561 commit bd3b2f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/elixir/lib/io.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ defmodule IO do
511511
"""
512512
@spec inspect(device, item, inspect_opts) :: item when item: var
513513
def inspect(device, item, opts) when is_device(device) and is_list(opts) do
514-
label = if label = opts[:label], do: [to_chardata(label), ": "], else: []
514+
{label, opts} = Keyword.pop(opts, :label)
515+
label = if label, do: [to_chardata(label), ": "], else: []
515516
opts = Inspect.Opts.new(opts)
516517
doc = Inspect.Algebra.group(Inspect.Algebra.to_doc(item, opts))
517518
chardata = Inspect.Algebra.format(doc, opts.width)

0 commit comments

Comments
 (0)