dwyl / dwyl/cid

Compiling warnings + Cid.cid/1 undefined

Open
#46 2 comments 1 reaction 0 assignees View on GitHub
help wanted technical user-feedback
Dominant language
Elixir
Stars
38
Forks
4
PR merge metrics
No merged PRs in 30d

Description

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
<>

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
<>

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

Conflict found at
lib/multihash.ex:87: Multihash.encode/3
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with lib/multihash.ex at lines 87 and 178-251, then run the compiler and Dialyzer to reproduce the reported warnings and Cid.cid/1 message. Trace the existing Cid.cid("something") call and confirm the intended public API. Done means the reported compilation warnings and undefined-function diagnostic are addressed without breaking the working call.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.