-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use ExMachina.Ecto defines functions with no local return #157
Comments
It turned out more complex than just those warnings because those were from Erlang 18.3 and Erlang 19.0+ gets a lot better dialyzer for maps, so there are more warnings on 19.0 that you're using on CircleCI. I can open a PR for just the 18.3 changes if you want. |
Yeah I think just the changed for 18.3 would be a great start. Thanks so much for catching those :) |
@KronicDeth I'm going to close this for now, although we're more than willing to accept a PR for this if you get around to it. |
Fixes #157 Since version 1.0.0, when users of ex_machina try to call the deprecated fields_for/2 function, it raises an exception. This doesn't seem to provide any benefit. If instead it's removed, calls to it will fail at compile time. But if it stays in, calls will fail at runtime, possibly in production. This PR solves the Dialyzer issue and it provides a better solution for dealing with the obsolete function.
In
test/support/factory.ex
, I haveThis works for the factories just fine, but
mix dialyze
thinks all function defined by theuse
have no local return:My work-around is
Since the functions are only there to raise errors, their specs can say as much as the work-around would not be necessary. I'll open a PR to do that.
The text was updated successfully, but these errors were encountered: