File 0750-Fix-ms_transform-format_error-1-spec-to-match-actual.patch of Package erlang

From d6df2ca49235cbd08f5a0ee1c918269e5ed6fbf5 Mon Sep 17 00:00:00 2001
From: Radek Szymczyszyn <lavrin@gmail.com>
Date: Thu, 12 Feb 2026 14:39:42 +0100
Subject: [PATCH] Fix ms_transform:format_error/1 spec to match actual clause
 patterns

The original spec declared `Error :: {error, module(), term()}` (a 3-tuple),
but the function clauses match integer error codes and various code-tagged
tuples. We could also go with just `Error :: Code | tuple()` for simplicity.

This original spec has looked like that at least
since stdlib-6.2.1 / Erlang 27.3.
---
 lib/stdlib/src/ms_transform.erl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/stdlib/src/ms_transform.erl b/lib/stdlib/src/ms_transform.erl
index ea86858d8f..940e14d1ee 100644
--- a/lib/stdlib/src/ms_transform.erl
+++ b/lib/stdlib/src/ms_transform.erl
@@ -80,7 +80,8 @@ Takes an error code returned by one of the other functions in the module and
 %%
 
 -spec(format_error(Error) -> Chars when
-      Error :: {error, module(), term()},
+      Error :: Code | {Code, _} | {Code, _, _} | {Code, _, _, _},
+      Code :: non_neg_integer(),
       Chars :: io_lib:chars()).
 
 format_error({?WARN_SHADOW_VAR,Name}) ->
-- 
2.51.0

openSUSE Build Service is sponsored by