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

Compiling warnings + Cid.cid/1 undefined #46

Open
ndrean opened this issue Aug 25, 2023 · 2 comments
Open

Compiling warnings + Cid.cid/1 undefined #46

ndrean opened this issue Aug 25, 2023 · 2 comments
Labels

Comments

@ndrean
Copy link

ndrean commented Aug 25, 2023

2 pb:

  • warnings when compiling (due to multihash) -> see below
    • message undefined via dializer, but... It still works ?!! I mean Cid.cid("something") |> dbg() gives me a result..!?
Screenshot 2023-08-26 at 09 01 57
warning: defp is_valid_hash_code/1 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:178: Multihash.is_valid_hash_code/1

warning: defp encode_internal/3 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:185: Multihash.encode_internal/3

warning: defp decode_internal/3 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:196: Multihash.decode_internal/3

warning: defp check_length/2 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:209: Multihash.check_length/2

warning: defp check_truncated_digest_length/3 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:219: Multihash.check_truncated_digest_length/3

warning: defp check_digest_length/2 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:229: Multihash.check_digest_length/2

warning: defp get_hash_info/1 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:239: Multihash.get_hash_info/1

warning: defp get_hash_function/1 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:245: Multihash.get_hash_function/1

warning: defp get_from_dict/3 is private, @doc attribute is always discarded for private functions/macros/types
  lib/multihash.ex:251: Multihash.get_from_dict/3

warning: incompatible types:

    float() !~ integer()

in expression:

    # lib/multihash.ex:87
    <<hash_code>>

where "hash_code" was given the type integer() | float() in:

    # lib/multihash.ex:86
    is_number(hash_code)

where "hash_code" was given the type integer() in:

    # lib/multihash.ex:87
    <<hash_code>>

HINT: all expressions given to binaries are assumed to be of type integer() unless said otherwise. For example, <<expr>> assumes "expr" is an integer. Pass a modifier, such as <<expr::float>> or <<expr::binary>>, to change the default behaviour.

Conflict found at
  lib/multihash.ex:87: Multihash.encode/3
@nelsonic
Copy link
Member

This is very strange. We haven't seen this on our side. 🤷‍♂️
Please test with the latest version of excid and confirm if it's still happening. 🙏

@ndrean
Copy link
Author

ndrean commented Sep 19, 2023

Yes it was 1.0, and I ran it 2 times (cleaned mix.lock & deps). So meanwhile I changed to produce a hash whilst stream reading a file (in case it is big) and use the hash as the filename. Starting to think my computer is haunted.

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