diff --git a/lib/elixir/lib/behaviour.ex b/lib/elixir/lib/behaviour.ex index 4a09938aa9..25ab6e0c0c 100644 --- a/lib/elixir/lib/behaviour.ex +++ b/lib/elixir/lib/behaviour.ex @@ -111,9 +111,9 @@ defmodule Behaviour do end end - defp __behaviour__doc_value(:none), do: nil - defp __behaviour__doc_value(:hidden), do: false defp __behaviour__doc_value(%{"en" => doc}), do: doc + defp __behaviour__doc_value(:hidden), do: false + defp __behaviour__doc_value(_), do: nil import unquote(__MODULE__) end diff --git a/lib/elixir/lib/code.ex b/lib/elixir/lib/code.ex index e4cb2f7abf..4bd32b993c 100644 --- a/lib/elixir/lib/code.ex +++ b/lib/elixir/lib/code.ex @@ -1348,7 +1348,7 @@ defmodule Code do | {:error, :module_not_found | :chunk_not_found | {:invalid_chunk, binary}} when annotation: :erl_anno.anno(), beam_language: :elixir | :erlang | atom(), - doc_content: %{required(binary) => binary} | :none | :hidden, + doc_content: %{optional(binary) => binary} | :none | :hidden, doc_element: {{kind :: atom, function_name :: atom, arity}, annotation, signature, doc_content, metadata}, diff --git a/lib/elixir/lib/kernel/typespec.ex b/lib/elixir/lib/kernel/typespec.ex index 7f56b3cd9c..f28c3dbf53 100644 --- a/lib/elixir/lib/kernel/typespec.ex +++ b/lib/elixir/lib/kernel/typespec.ex @@ -23,6 +23,7 @@ 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}