Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Bamboo.Mailer causes dialyzer error #586

Closed
mjquinlan2000 opened this issue Feb 23, 2021 · 3 comments
Closed

use Bamboo.Mailer causes dialyzer error #586

mjquinlan2000 opened this issue Feb 23, 2021 · 3 comments

Comments

@mjquinlan2000
Copy link

I'm getting dialyzer errors when using Bamboo.Mailer on Bamboo 2.0

Example:

defmodule Tmp.Mailer do
  use Bamboo.Mailer, otp_app: :tmp
end

Produces

lib/mailer.ex:2:invalid_contract
The @spec for the function does not match the success typing of the function.

Function:
Tmp.Mailer.deliver_later/1

Success typing:
@spec deliver_later(_) ::
  {:error,
   <<_::64, _::size(8)>>
   | %{
       :__exception__ => true,
       :__struct__ => Bamboo.EmptyFromAddressError | Bamboo.NilRecipientsError,
       :message => <<_::64, _::size(8)>>
     }}
  | {:ok,
     %{
       :bcc => {binary(), binary()},
       :cc => {binary(), binary()},
       :from => {binary(), binary()},
       :to => {binary(), binary()},
       _ => _
     }}

________________________________________________________________________________
done (warnings were emitted)
Halting VM with exit status 2
@germsvel
Copy link
Collaborator

Hi @mjquinlan2000 thanks for opening this issue. I think this has already been resolved in #584. I haven't cut a release for that fix yet, but I will as soon as I can.

@mjquinlan2000
Copy link
Author

Thanks for the quick response @germsvel I missed that when I was searching the open issues.

Feel free to close this unless you want to keep it open until the release comes out.

FYI you can circumvent this issue by putting

@dialyzer {:nowarn_function, deliver_later: 1}

In the mailer module.

@germsvel
Copy link
Collaborator

Thanks @mjquinlan2000. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants