Skip to content

Compiling warnings + Cid.cid/1 undefined #46

@ndrean

Description

@ndrean

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions