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

Remove comparison of distinct types #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

camelpunch
Copy link

Elixir 1.18.x complains about the comparison of these operands:

warning: comparison between distinct types found:

        first != 47

    given types:

        binary() != integer()

    where "first" was given the type:

        # type: binary()
        # from: lib/ex_image_info/types/webp.ex:29:61
        <<..., first::binary-size(1), ...>>

    While Elixir can compare across all types, you are comparing across types which are always disjoint, and the result is either always true or always false

    typing violation found at:

 35 │       lossy == " " and first != 0x2F -> parse_lossy(first, next)
    │                              ~

    └─ lib/ex_image_info/types/webp.ex:35:30: ExImageInfo.Types.WEBP.info/1

Elixir 1.18.x complains about the comparison of these operands.
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.

1 participant