Skip to content

Commit 36c06c3

Browse files
michallepickijosevalim
authored andcommitted
Fix JSON.decode/3 spec (#14068)
The error clause was missing the :error tuple wrapping
1 parent 048cc2d commit 36c06c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/elixir/lib/json.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ defmodule JSON do
265265
266266
For streaming decoding, see Erlang's `:json` module.
267267
"""
268-
@spec decode(binary(), term(), keyword()) :: {term(), term(), binary()} | decode_error_reason()
268+
@spec decode(binary(), term(), keyword()) ::
269+
{term(), term(), binary()} | {:error, decode_error_reason()}
269270
def decode(binary, acc, decoders) when is_binary(binary) and is_list(decoders) do
270271
decoders = Keyword.put_new(decoders, :null, nil)
271272

0 commit comments

Comments
 (0)