I am confused.
I have a function with a spec
@spec send(Schema.DocumentStore.t()) :: {:ok, any()} | {:error, any()}
def send(document) do
with {:ok, .....} do
{:ok, response}
else
{:error, msg} -> {:error, msg]
end
end
I am calling this function as
case send(document) do
{:ok, response} ->
do something
{:error, msg} ->
log error
end
I get the warning
ElixirLS Dialyzer: The pattern can never match the type.
Pattern:
{:ok, _response}
Type:
{:error, <<_::112>>}
And I don’t get why.