File 0589-Add-no_return-spec-to-gen_statem-init-1-note.patch of Package erlang
From adb748ca9a5dcfdc744d2f0c490d7ddb38a7ca9c Mon Sep 17 00:00:00 2001
From: Maria Scott <67057258+Maria-12648430@users.noreply.github.com>
Date: Thu, 1 Jul 2021 14:59:53 +0200
Subject: [PATCH] Add no_return() spec to gen_statem:init/1 note
If no spec is given, dialyzer will complain
that init/1 only terminates with explicit
exception.
---
lib/stdlib/doc/src/gen_statem.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/stdlib/doc/src/gen_statem.xml b/lib/stdlib/doc/src/gen_statem.xml
index 1fcc104013..c6790c1d48 100644
--- a/lib/stdlib/doc/src/gen_statem.xml
+++ b/lib/stdlib/doc/src/gen_statem.xml
@@ -2469,6 +2469,7 @@ handle_event(_, _, State, Data) ->
in that case be implemented as:
</p>
<pre>
+-spec init(_) -> no_return().
init(Args) -> erlang:error(not_implemented, [Args]).</pre>
</note>
</desc>
--
2.26.2