-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Enable -Wunmatched_return in dialyzer #508
Conversation
@BrandtHill There's a lot of voice-related warnings from Dialyzer here, where we are ignoring potential ok / error results. Do you think we should ignore the results as we do presently or match against them? lib/nostrum/shard/dispatch.ex:346:unmatched_return
The expression produces a value of type:
nil | :ok | {:error, <<_::248, _::size(32)>>}
but this value is unmatched.
________________________________________________________________________________
lib/nostrum/voice.ex:556:unmatched_return
The expression produces a value of type:
{_, boolean()}
but this value is unmatched.
________________________________________________________________________________
lib/nostrum/voice.ex:576:unmatched_return
The expression produces a value of type:
:ignore | {:error, _} | {:ok, pid()} | {:ok, pid(), _}
but this value is unmatched.
________________________________________________________________________________
lib/nostrum/voice.ex:755:unmatched_return
The expression produces a value of type:
:ignore | nil | {:error, _} | {:ok, pid()} | {:ok, pid(), _}
but this value is unmatched.
________________________________________________________________________________
lib/nostrum/voice/audio.ex:127:unmatched_return
The expression produces a value of type:
{:error, _} | {:ok, :cancel}
but this value is unmatched.
________________________________________________________________________________
lib/nostrum/voice/audio.ex:139:unmatched_return
The expression produces a value of type:
:ok | {:error, atom()}
but this value is unmatched.
________________________________________________________________________________
lib/nostrum/voice/ports.ex:43:unmatched_return
The expression produces a value of type:
nil | {:ok, pid()}
but this value is unmatched.
________________________________________________________________________________
lib/nostrum/voice/session.ex:124:unmatched_return
The expression produces a value of type:
{:error, _} | {:ok, :cancel}
but this value is unmatched.
________________________________________________________________________________
done (warnings were emitted) |
I've added matching to most of these, but the others should be ignored PR into this branch: #509 |
Thank you!
|
724d031
to
fdbf372
Compare
bc43112
to
0e5207f
Compare
0e5207f
to
ace7cf4
Compare
Not all warnings were fixed as Elixir's `is_nil` in conditions does not seem to play well with dialyzer.
ace7cf4
to
435a147
Compare
Ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid, and works locally, so no complaints here.
Thanks! |
No description provided.