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

Fix some dialyzer warnings #712

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix some dialyzer warnings #712

wants to merge 1 commit into from

Conversation

NAR
Copy link

@NAR NAR commented Mar 16, 2020

This pull request fixes two sets of dialyzer warnings:

  • It looks like the time field in the txq record can actually be undefined (for example when the rx2_rf exported function is called), so update the typespec to let the time to be undefined.
  • In the inc(undefined) clause in lorawan_utils the Num parameter could never be undefined (unless after a database upgrade?).

Generally, are you interested in similar dialyzer-related cleanups?

The time field in the txq record can actually be undefined (for example
when the rx2_rf exported function is called), so update the typespec to
enable the time to be undefined.
@@ -159,7 +159,6 @@ event_args(Event) when is_atom(Event) ->
event_args(Event) when is_binary(Event) ->
{Event, undefined}.

inc(undefined) -> 1;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has a reason. The dialyzer is wrong when saying this will never be used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'm removing this commit.

@NAR NAR requested a review from gotthardp March 17, 2020 08:56
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

Successfully merging this pull request may close these issues.

2 participants