ecto_shorts icon indicating copy to clipboard operation
ecto_shorts copied to clipboard

remove Ecto.Schema.t as option for first argument in Actions.create

Open CorneliaKelinske opened this issue 1 year ago • 0 comments

This is the fix for those two dialyzer errors:

lib/actions.ex:173:invalid_contract
The @spec for the function does not match the success typing of the function.

Function:
EctoShorts.Actions.create/3

Success typing:
@spec create(atom(), _, Keyword.t()) :: any()

lib/actions.ex:174:invalid_contract
The @spec for the function does not match the success typing of the function.

Function:
EctoShorts.Actions.create/2

Success typing:
@spec create(atom(), _) :: any()

Explanation: Actions.create calls Actions.create_changeset/2, which in turn calls function_exported?/3 and that one only takes a module as the first argument.

CorneliaKelinske avatar Aug 14 '22 14:08 CorneliaKelinske