TurtleAI / derive

An Event Sourcing and CQRS solution.
0 stars 1 forks source link

Dialyzer specs for behaviors #9

Closed venkatd closed 2 years ago

venkatd commented 2 years ago

Hi @TurtleAI/eds

In several places throughout the code we pass around modules that implement behaviors.

For example here:

https://github.com/TurtleAI/derive/blob/b8d567065a381d8a5335cc227f90e134c3f520fb/lib/derive/migration.ex#L9-L10

We the Derive.Reducer.t() typespec is just an alias to module()

However, what I really want is to accept modules that implement behaviors so I can get vscode to give me warnings if I mistype a function or pass in a module that doesn't have the desired methods.

Is this possible?

josevalim commented 2 years ago

Unfortunately it is not possible. :( I would also love to have this feature.

venkatd commented 2 years ago

:( no problem, hopefully one day!