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

Failed to parse warning #438

Open
parry84 opened this issue Aug 12, 2021 · 1 comment
Open

Failed to parse warning #438

parry84 opened this issue Aug 12, 2021 · 1 comment

Comments

@parry84
Copy link

parry84 commented Aug 12, 2021

Failed to parse warning:
[{:"{", 1}, {:atom_full, 1, ''ok''}, {:",", 1}, {:"#", 1}, {:"{", 1}, {:atom_full, 1, ''__typename''}, {:":=", 1}, {:<, 1}, {:<, 1}, {:int, 1, 384677985324449735536498}, {:":", 1}, {:int, 1, 80}, {:>, 1}, {:>, 1}, {:",", 1}, {:atom_full, 1, ''error''}, {:":=", 1}, {:<, 1}, {:<, 1}, {:int, 1, 2037172997037120384612}, {:":", 1}, {:int, 1, 72}, {:>, 1}, {:>, 1}, {:"}", 1}, {:"}", 1}]

Legacy warning:
service.ex:0: The pattern {'ok', #{'__typename':=<<384677985324449735536498:80>>, 'error':=<<2037172997037120384612:72>>}} can never match the type {'ok',#{'installment_prices':=[]}}


Snippet to reproduce:

    {:ok, %{installment_prices: []}}
    |> case do
      {:ok, %{__typename: "Error", error: "not_found"}} ->
        {:error, :not_found}

      {:ok, %{installment_prices: installment_prices}} ->
        {:ok, Helpers.GraphQLUtils.format_response(installment_prices)}
@JonRowe
Copy link

JonRowe commented Oct 22, 2021

I think I have another example of this, dialyzer asked me nicely to open an issue but as I think this is a duplicate I'll add it here:

Failed to parse warning:
[{:<, 1}, {:<, 1}, {:<, 1}, {:int, 1, 36343226021761516267932838254}, {:":", 1}, {:int, 1, 96}, {:>, 1}, {:>, 1}, {:",", 1}, {:_, 1}, {:atom_part, 1, 'v'}, {:atom_part, 1, 'a'}, {:atom_part, 1, 'l'}, {:atom_part, 1, 'u'}, {:atom_part, 1, 'e'}, {:atom_part, 1, '@'}, {:int, 1, 1}, {:",", 1}, {:"#", 1}, {:"{", 1}, {:atom_full, 1, '\'county_code\''}, {:":=", 1}, {:_, 1}, {:atom_part, 1, 'c'}, {:atom_part, 1, 'o'}, {:atom_part, 1, 'u'}, {:atom_part, 1, 'n'}, {:atom_part, 1, 't'}, {:atom_part, 1, 'r'}, {:atom_part, 1, 'y'}, {:_, 1}, {:atom_part, 1, 'c'}, {:atom_part, 1, 'o'}, {:atom_part, 1, 'd'}, {:atom_part, 1, 'e'}, {:atom_part, 1, '@'}, {:int, 1, 1}, {:",", 1}, {:atom_full, 1, '\'ein\''}, {:":=", 1}, {:_, 1}, {:atom_part, 1, 'e'}, {:atom_part, 1, 'i'}, {:atom_part, 1, 'n'}, {:atom_part, 1, '@'}, {:int, 1, 1}, {:"}", 1}, {:>, 1}]

The underlying error was actually a typo in the map field matching against a struct

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

No branches or pull requests

2 participants