Skip to content

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

Description

@vdegove

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions