diff --git a/lib/ex_doc/retriever.ex b/lib/ex_doc/retriever.ex index ee36188f9..54ed4a4bc 100644 --- a/lib/ex_doc/retriever.ex +++ b/lib/ex_doc/retriever.ex @@ -507,11 +507,20 @@ defmodule ExDoc.Retriever do exported = :lists.flatten(exported) (Code.get_docs(module_info.name, :type_docs) || []) - |> Enum.filter(&elem(&1, 0) in exported) + |> Enum.filter(&(elem(&1, 0) in exported && typedoc?(&1))) |> Enum.sort_by(&elem(&1, 0)) |> Enum.map(&get_type(&1, source, module_info.abst_code)) end + # Skip typedocs explicitly marked as false + defp typedoc?({_, _, _, false}) do + false + end + + defp typedoc?({_, _, _, _}) do + true + end + defp get_type(type, source, abst_code) do {{name, arity}, doc_line, _, doc} = type diff --git a/test/fixtures/types_and_specs.ex b/test/fixtures/types_and_specs.ex index 9d5d3728e..1bb2613a4 100644 --- a/test/fixtures/types_and_specs.ex +++ b/test/fixtures/types_and_specs.ex @@ -15,6 +15,8 @@ defmodule TypesAndSpecs do @typep private :: any @opaque opaque :: {Dict.t} @type ref :: {:binary.part, public(any)} + @typedoc false + @type internal :: any @spec add(integer, opaque) :: integer def add(x, _), do: x + x