safwank / ElixirRetry

Simple Elixir macros for linear retry, exponential backoff and wait with composable delays
Other
441 stars 32 forks source link

Fix Dialyzer warning #29

Closed legoscia closed 5 years ago

legoscia commented 5 years ago

In case the block always returns {atom(), _}, the second case clause in Retry.block_runner would never match, causing a Dialyzer 'pattern_match_cov' error:

The pattern
variable__

can never match since previous clauses completely cover the type

[...]

Let's mark the quoted code as "generated", thereby avoiding such warnings.

safwank commented 5 years ago

Thanks for the PR! I've been looking for a solution to this issue for awhile. Where's this feature documented?

Also, AFAIK this is no longer an issue in Elixir >=1.6. Can you confirm it?

safwank commented 5 years ago

Nevermind, found it https://hexdocs.pm/elixir/Kernel.SpecialForms.html#quote/2 👍

legoscia commented 5 years ago

Thanks for merging! I've seen this issue with Elixir 1.7 - haven't tested earlier versions.