File 0965-edoc-Fix-specs-for-all-documented-functions.patch of Package erlang

From 6a461efc86c6d131fed42a5fadcb62b6facdf57c Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Thu, 4 Jan 2024 14:26:55 +0100
Subject: [PATCH 2/6] edoc: Fix specs for all documented functions

---
 lib/edoc/src/edoc_layout.erl | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/edoc/src/edoc_layout.erl b/lib/edoc/src/edoc_layout.erl
index 802e88b124..f6f11ae5d8 100644
--- a/lib/edoc/src/edoc_layout.erl
+++ b/lib/edoc/src/edoc_layout.erl
@@ -55,6 +55,12 @@
 -define(FUNCTIONS_TITLE, "Function Details").
 -define(FUNCTIONS_LABEL, "functions").
 
+-type options() :: [{index_columns, integer()} |
+                    {pretty_printer, atom()} |
+                    {stylesheet, string()} |
+                    {sort_functions, boolean()} |
+                    {xml_export, module()}].
+
 %% @doc The layout function.
 %%
 %% Options to the standard layout:
@@ -94,7 +100,9 @@
 %% @see edoc:layout/2
 
 %% NEW-OPTIONS: xml_export, index_columns, stylesheet
-
+-spec module(Element, Options) -> term() when
+      Element :: edoc:edoc_module(),
+      Options :: options().
 module(Element, Options) ->
     XML = layout_module(Element, init_opts(Element, Options)),
     Export = proplists:get_value(xml_export, Options,
@@ -1034,6 +1042,7 @@ xhtml(Title, CSS, Body, Encoding) ->
 
 %% ---------------------------------------------------------------------
 
+-spec type(Element :: term()) -> term().
 type(E) ->
     Opts = init_opts(E, []),
     type(E, [], Opts).
@@ -1042,6 +1051,7 @@ type(E, Ds, Opts) ->
     xmerl:export_simple_content(t_utype_elem(E, Opts) ++ local_defs(Ds, Opts),
 				?HTML_EXPORT).
 
+-spec overview(Element :: term(), Options :: options()) -> term().
 overview(E=#xmlElement{name = overview, content = Es}, Options) ->
     Opts = init_opts(E, Options),
     Title = [get_text(title, Es)],
-- 
2.35.3

openSUSE Build Service is sponsored by