File 1067-docs-add-note-about-anonymous-type-variables.patch of Package erlang
From 03cfb72b67b14cf370179fe963ce07cfa0322e0e Mon Sep 17 00:00:00 2001
From: Kiko Fernandez-Reyes <kiko@erlang.org>
Date: Mon, 10 Oct 2022 08:23:49 +0200
Subject: [PATCH] docs: add note about anonymous type variables
---
system/doc/reference_manual/typespec.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/system/doc/reference_manual/typespec.xml b/system/doc/reference_manual/typespec.xml
index 03a83680a8..9ab409b7ac 100644
--- a/system/doc/reference_manual/typespec.xml
+++ b/system/doc/reference_manual/typespec.xml
@@ -607,5 +607,14 @@
of the following form:
</p>
<pre> -spec my_error(term()) -> no_return().</pre>
+
+ <note>
+ <p>Erlang uses the shorthand version <c>_</c> as an anonymous type variable
+ equivalent to <c>term()</c> or <c>any()</c>. For example, the following function
+ <pre> -spec Function(string(), _) -> string().</pre>
+ is equivalent to:
+ <pre> -spec Function(string(), any()) -> string().</pre>
+ </p>
+ </note>
</section>
</chapter>
--
2.35.3