Skip to content

Commit d6df2ca

Browse files
committed
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.
1 parent 74cd1dc commit d6df2ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/stdlib/src/ms_transform.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ Takes an error code returned by one of the other functions in the module and
8080
creates a textual description of the error.
8181
""".
8282
-spec(format_error(Error) -> Chars when
83-
Error :: {error, module(), term()},
83+
Error :: Code | {Code, _} | {Code, _, _} | {Code, _, _, _},
84+
Code :: non_neg_integer(),
8485
Chars :: io_lib:chars()).
8586

8687
format_error({?WARN_SHADOW_VAR,Name}) ->

0 commit comments

Comments
 (0)