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 issues with dialyzer infinite loop #7993

Merged
merged 3 commits into from
Jul 26, 2018
Merged

Fix issues with dialyzer infinite loop #7993

merged 3 commits into from
Jul 26, 2018

Conversation

michalmuskala
Copy link
Member

Closes #7989

true <- unquote(guard_date) do
{year, month, day} = unquote(read_date)

with {:ok, date} <- new(year, month, day, Calendar.ISO) do
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not squash it into single with like:

with unquote(match_date) <- string,
     true <- unquote(guard_date),
     {year, month, day} = unquote(read_date),
     {:ok, date} <- new(year, month, day, Calendar.ISO) do

Copy link
Member

Choose a reason for hiding this comment

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

Because they have different elses.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahhh, true

{:error, :invalid_format}
[match_date, guard_date, read_date] = Calendar.ISO.__match_date__()

def raw_from_iso8601(string, calendar) do
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be a private function defp

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@josevalim josevalim merged commit 791e69a into master Jul 26, 2018
@josevalim
Copy link
Member

❤️ 💚 💙 💛 💜

@josevalim josevalim deleted the mm/dialyzer_fix branch July 26, 2018 19:29
josevalim pushed a commit that referenced this pull request Jul 26, 2018
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants