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 dialyzer issues with interval extension, part 2 #702

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

greg-rychlewski
Copy link
Member

Really not sure about the latest warning

deps/postgrex/lib/postgrex/type_module.ex:1084:call
The function call will not succeed.

:erlang.band(_mod :: nil, 65535)

will never return since the 1st arguments differ
from the success typing arguments:

(integer(), integer())

@oliver-kriska could you try this branch before we merge? ty

@oliver-kriska
Copy link

unfortunately still same issue

deps/postgrex/lib/postgrex/type_module.ex:1084:call
The function call will not succeed.

:erlang.band(_ :: nil, 65535)

will never return since the 1st arguments differ
from the success typing arguments:

(integer(), integer())

@greg-rychlewski
Copy link
Member Author

generated: true it is :) . this warning seems pretty unreasonable

@oliver-kriska
Copy link

still same

def decode(type) do
      quote location: :keep, generated: true do
        <<16::int32(), microseconds::int64(), days::int32(), months::int32()>> ->
          type_mod = var!(mod)
          precision = if type_mod, do: type_mod &&& unquote(@precision_mask)

          unquote(__MODULE__).decode_interval(
            microseconds,
            days,
            months,
            precision,
            unquote(type)
          )
      end
    end

and error:


deps/postgrex/lib/postgrex/type_module.ex:1084:call
The function call will not succeed.

:erlang.band(_ :: nil, 65535)

will never return since the 1st arguments differ
from the success typing arguments:

(integer(), integer())

@josevalim
Copy link
Member

@greg-rychlewski maybe move the band to the decode_interval functions?

@greg-rychlewski
Copy link
Member Author

@oliver-kriska sorry, one more time when you have the chance :)

@oliver-kriska
Copy link

it works. Good job and thank you :)

@greg-rychlewski
Copy link
Member Author

thanks to @josevalim . i had no clue what was happening

@greg-rychlewski greg-rychlewski merged commit 66a4682 into elixir-ecto:master Aug 7, 2024
9 checks passed
@greg-rychlewski greg-rychlewski deleted the dialyzer branch August 7, 2024 14:20
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.

3 participants