My usecase is, I want to override
Ecto.Association.NotLoaded's Jason.Encoder implementation, so it returns
nil instead of raising. It works if I simply just do it, but not without warnings.
defimpl Jason.Encoder, for: Ecto.Association.NotLoaded do def encode(_struct, _opts), do: "null" end
warning: redefining module Jason.Encoder.Ecto.Association.NotLoaded (current version loaded from _build/dev/lib/ecto/ebin/Elixir.Jason.Encoder.Ecto. Association.NotLoaded.beam) lib/app_web/views/not_loaded.ex:1
warning: this clause cannot match because a previous clause at line 1 always matches deps/jason/lib/encoder.ex:1
So the question is, is it possible to do this without warnings?