ecto_autoslug_field icon indicating copy to clipboard operation
ecto_autoslug_field copied to clipboard

Function build_slug/1 has no local return

Open krainboltgreene opened this issue 2 years ago • 0 comments

Here's the error:

lib/ecto_autoslug_field/slug.ex:3:no_return
Function build_slug/1 has no local return.
________________________________________________________________________________
lib/ecto_autoslug_field/slug.ex:3:no_return
Function build_slug/2 has no local return.
________________________________________________________________________________
lib/ecto_autoslug_field/slug.ex:218:call
The function call will not succeed.

EctoAutoslugField.SlugBase.build_slug(_ :: any(), nil)

will never return since the 2nd arguments differ
from the success typing arguments:

(Keyword.t(), %Ecto.Changeset{
  :action => atom(),
  :changes => %{atom() => _},
  :constraints => [
    %{
      :constraint => binary(),
      :error_message => binary(),
      :error_type => atom(),
      :field => atom(),
      :match => :exact | :prefix | :suffix,
      :type => :check | :exclusion | :foreign_key | :unique
    }
  ],
  :data => nil | map(),
  :empty_values => _,
  :errors => Keyword.t({_, _}),
  :filters => %{atom() => _},
  :params => nil | %{binary() => _},
  :prepare => [(_ -> any())],
  :repo => atom(),
  :repo_opts => Keyword.t(),
  :required => [atom()],
  :types =>
    nil
    | %{
        atom() =>
          atom()
          | {:array | :assoc | :embed | :in | :map | :maybe | :param, _}
          | {:parameterized, atom(), _}
      },
  :valid? => boolean(),
  :validations => Keyword.t()
})

I'm using the library according to the docs.

krainboltgreene avatar Feb 27 '22 21:02 krainboltgreene