Skip to content

Conversation

@sekiyama58
Copy link

Currently dialyzer causes some warnings (see below), so this fixes the warnings.

In addition, the error responses on failure in set are also fixed. It returns map that has item key and error string (e.g. %{"some_key" => {:error, :closed}}).

It also adds .dialyzer_ignore for an error that Cream.Continum.alive? (defined in lib/cream/continuum.ex) always returns true.

lib/cream/cluster.ex:301: The call maps:values('ok' | {'error',binary()}) breaks the contract (Map) -> Values when Map :: map(), Values :: [Value], Value :: term()
lib/cream/cluster.ex:319: The pattern #{Vkey@1:=Vvalue@1} can never match the type [{binary(),binary() | [any()] | map()} | #{binary()=>binary() | [any()] | map()}]
lib/cream/cluster.ex:361: The created fun has no local return
lib/cream/cluster.ex:363: The pattern #{Vkey@1:=Vvalue@1} can never match the type [{binary(),binary() | [any()] | map()} | #{binary()=>binary() | [any()] | map()}]
lib/cream/cluster.ex:365: The pattern #{} can never match the type [{binary(),binary() | [any()] | map()} | #{binary()=>binary() | [any()] | map()}]
lib/cream/cluster.ex:374: The created fun has no local return
lib/cream/cluster.ex:376: The created fun has no local return
lib/cream/cluster.ex:376: The call maps:is_key(_@1::any(),Vhits@1::[{binary(),binary() | [any()] | map()} | #{binary()=>binary() | [any()] | map()}]) will never return since it differs in the 2nd argument from the success typing arguments: (any(),map())
lib/cream/cluster.ex:379: The call maps:merge(Vhits@1::[{binary(),binary() | [any()] | map()} | #{binary()=>binary() | [any()] | map()}],Vmissing_hits@1::[{binary(),binary() | [any()] | map()} | #{binary()=>binary() | [any()] | map()}] | {binary(),binary() | [any()] | map()}) will never return since it differs in the 1st and 2nd argument from the success typing arguments: (map(),map())
lib/cream/continuum.ex:42: Guard test _@1::'true' =:= 'false' can never succeed

sekiyama58 pushed a commit to sekiyama58/cream_ex that referenced this pull request May 19, 2021
Fix dialyzer warnings & error response on set
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