B
Size: a a a
B
B
mimemail =
{<<"text">>, <<"html">>,
[
{<<"From">>, from},
{<<"To">>, to},
{<<"Subject">>, <<"#{content.subject}">>},
{<<"Content-Type">>, <<"text/html; charset=utf-8">>}],
[{<<"transfer-encoding">>, <<"base64">>}],
content.message}
mime = :mimemail.encode(mimemail)
:gen_smtp_client.deliver(
socket,
{from, [to], mime}
)
B
AB
AB
V
@spec myfunc(String.t()) :: {:ok, value} | {:error, :reason1} | {:error, :reason2, details}
Диалайзер видит сигнатуру возврата только {:error, :reason1}
.case myfunc(x) doругается.
{:ok, value} ->
или
{:error, :reason2, _}
LL
@spec myfunc(String.t()) :: {:ok, value} | {:error, :reason1} | {:error, :reason2, details}
Диалайзер видит сигнатуру возврата только {:error, :reason1}
.case myfunc(x) doругается.
{:ok, value} ->
или
{:error, :reason2, _}
V
The pattern can never match the type.
V
IK
{:error, :reason1}
?IK
case func(x) do
{:ok, _} -> ...
{:error, :reason1} -> ...
{:error, :reason2, _} -> ...
end
V
IK
V
LL
@spec myfunc(String.t()) :: {:ok, value} | {:error, :reason1} | {:error, :reason2, details}
Диалайзер видит сигнатуру возврата только {:error, :reason1}
.case myfunc(x) doругается.
{:ok, value} ->
или
{:error, :reason2, _}
reason
— атом?V
@spec myfunc(String.t()) :: {:ok, value} | {:error, :reason1} | {:error, :reason2, details}
def myfunc(arg), do ...
lib/app.ex:28:pattern_match
The pattern can never match the type.
Pattern:
{:ok, _value}
Type:
{:error, :reason1}
V
reason
— атом?V
V
ML