You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For all callbacks on behaviour modules, we should switch from calling module.callback to calling Behaviour.callback(module, ...). These wrapper functions will do two things:
they will have type specs that allow for dialyzer to know what these functions return
they will match on the return types, and if they don't return a valid return value, they will instead raise an Ash.Error.Framework.InvalidReturnType explaining the bad return type.
This will make dialyzer more helpful throughout the project and also help users when they accidentally return the wrong value from a callback function.
The text was updated successfully, but these errors were encountered:
zachdaniel
changed the title
Validate return types of all calls to changes/preparations/validations
Validate return types of all behavior callbacks
May 16, 2024
The steps for this:
For all callbacks on behaviour modules, we should switch from calling
module.callback
to callingBehaviour.callback(module, ...)
. These wrapper functions will do two things:Ash.Error.Framework.InvalidReturnType
explaining the bad return type.This will make dialyzer more helpful throughout the project and also help users when they accidentally return the wrong value from a callback function.
The text was updated successfully, but these errors were encountered: