Skip to content
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

Unknown type error in Dialyxir when using cloak_ecto with typed_ecto_schema #55

Open
vdegove opened this issue Apr 26, 2024 · 0 comments

Comments

@vdegove
Copy link

vdegove commented Apr 26, 2024

When using cloak_ecto in a typed Ecto Schema (see https://hexdocs.pm/typed_ecto_schema/), Dialyxir (see https://hex.pm/packages/dialyxir) halts with an unknown type error:

$ mix dialyzer

[…]

lib/db/contact.ex:0:unknown_type
Unknown type: Cloak.Ecto.SHA256.t/0.
________________________________________________________________________________
lib/db/contact.ex:0:unknown_type
Unknown type: DB.Encrypted.Binary.t/0.

Ecto Schema:

defmodule DB.Contact do

  typed_schema "contact" do
    field(:email, DB.Encrypted.Binary)
  end
end
defmodule DB.Encrypted.Binary do
  use Cloak.Ecto.Binary, vault: Transport.Vault
end

See https://github.com/etalab/transport-site/blob/master/apps/transport/lib/db/contact.ex, to reproduce the problem remove the line in .dialyzer_ignore.exs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant