Skip to content

Return :ok from Steward.provide/2 as specced - #443

Open
lukaszsamson wants to merge 1 commit into
whitfin:mainfrom
lukaszsamson:fix-steward-provide-spec
Open

lukaszsamson wants to merge 1 commit into
whitfin:mainfrom
lukaszsamson:fix-steward-provide-spec

Conversation

@lukaszsamson

Copy link
Copy Markdown

Found with SpecLint on elixir 1.20.4

lib/cachex/services/steward.ex:35: error: Cachex.Services.Steward.provide/2: inferred return list({:cachex_provision, {:cache, term()}}) is disjoint from the spec return :ok
    @spec provide(
  Cachex.t(),
  {atom(), any()}
) :: :ok
    inferred: ({:cache, term(), term(), term(), term(), term(), term(), term(), term(), term(), term()}, {:cache, term()}) -> dynamic(list({:cachex_provision, {:cache, term()}}))

provide/2 is specced to return :ok but returned the list built by its trailing for comprehension (e.g. [{:cachex_provision, {:cache, cache}}]). It now returns :ok; the only caller (Overseer) ignores the result.

This branch has not been deployed

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