Skip to content
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

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Conversation

jchristgit
Copy link
Collaborator

No description provided.

@jchristgit
Copy link
Collaborator Author

@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)

@BrandtHill
Copy link
Contributor

BrandtHill commented Jun 11, 2023

I've added matching to most of these, but the others should be ignored

PR into this branch: #509

@jchristgit
Copy link
Collaborator Author

jchristgit commented Jun 12, 2023 via email

@jchristgit jchristgit force-pushed the dialyzer-unmatched-return branch from 724d031 to fdbf372 Compare April 19, 2024 15:19
@jchristgit jchristgit force-pushed the dialyzer-unmatched-return branch 2 times, most recently from bc43112 to 0e5207f Compare May 11, 2024 13:47
@jchristgit jchristgit force-pushed the dialyzer-unmatched-return branch from 0e5207f to ace7cf4 Compare June 19, 2024 18:58
Not all warnings were fixed as Elixir's `is_nil` in conditions does not
seem to play well with dialyzer.
@jchristgit jchristgit force-pushed the dialyzer-unmatched-return branch from ace7cf4 to 435a147 Compare June 19, 2024 19:00
@jchristgit jchristgit marked this pull request as ready for review June 19, 2024 19:01
@jchristgit
Copy link
Collaborator Author

Ready for review.

Copy link
Collaborator

@jb3 jb3 left a 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.

@jb3 jb3 merged commit ae77945 into master Jun 19, 2024
9 checks passed
@jb3 jb3 deleted the dialyzer-unmatched-return branch June 19, 2024 19:19
@jb3
Copy link
Collaborator

jb3 commented Jun 19, 2024

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants