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

Incorrect spec for find functions #172

Open
al2o3cr opened this issue Apr 5, 2022 · 0 comments
Open

Incorrect spec for find functions #172

al2o3cr opened this issue Apr 5, 2022 · 0 comments
Labels

Comments

@al2o3cr
Copy link

al2o3cr commented Apr 5, 2022

ExTwilio.Resource creates a find/2 function with a return type of Parser.parsed_list_response():

https://github.com/danielberkompas/ex_twilio/blob/master/lib/ex_twilio/resource.ex#L60-L63

but the function it calls (ExTwilio.Api.find/3) returns a Parser.parsed_response:

https://github.com/danielberkompas/ex_twilio/blob/master/lib/ex_twilio/api.ex#L47-L53

This causes Dialyzer failures on working code like:

    case IncomingPhoneNumber.find(sid, opts) do
      {:ok, _} ->
        update_query =
          from(n in TwilioNumber,
            where: n.id == ^id,
            update: [set: [released?: false, campaign_id: nil]]
          )

        Repo.update_all(update_query, [])

        :ok

      _ ->
        :not_updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants