Skip to content

Commit

Permalink
Handle empty map in other places, closes #10343
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Sep 18, 2020
1 parent 08f6bbd commit df04a2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lib/elixir/lib/kernel/typespec.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ defmodule Kernel.Typespec do
for {{:type, name, arity}, _, _, doc, _} <- docs do
case doc do
%{"en" => doc_string} -> {{name, arity}, doc_string}
%{} -> {{name, arity}, nil}
:none -> {{name, arity}, nil}
# Hidden or unknown format are ignored
_ -> {{name, arity}, false}
:hidden -> {{name, arity}, false}
_ -> {{name, arity}, nil}
end
end

Expand Down
3 changes: 2 additions & 1 deletion lib/iex/lib/iex/introspection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,10 @@ defmodule IEx.Introspection do
doc && IO.ANSI.Docs.print(doc, format, opts)
end

defp translate_doc(%{"en" => doc}), do: doc
defp translate_doc(%{}), do: nil
defp translate_doc(:none), do: nil
defp translate_doc(:hidden), do: nil
defp translate_doc(%{"en" => doc}), do: doc

defp no_beam(module) do
case Code.ensure_loaded(module) do
Expand Down

0 comments on commit df04a2d

Please sign in to comment.