Skip to content

Instantly share code, notes, and snippets.

@P-Seebauer
Created April 4, 2018 23:08
Show Gist options
  • Save P-Seebauer/b7144d3fb4a47bc1ee3066cb161a965d to your computer and use it in GitHub Desktop.
Save P-Seebauer/b7144d3fb4a47bc1ee3066cb161a965d to your computer and use it in GitHub Desktop.
problem with dialyzer
defmodule Argon2Test do
@hash_for_foo "$argon2i$v=19$m=65536,t=6,p=1$dxSBP76R4icBDzu06CJRBQ$q4v8CePvqsdbSNBjBS0RRibryQI3Xo6ahYSqUZbdNaI"
@spec test_pass(String.t) :: (:failed | {:ok, map()})
def test_pass(pass) do
db_user = %{password_hash: @hash_for_foo}
with {:ok, ^db_user} <- Comeonin.Argon2.check_pass(db_user, pass) do
{:ok, db_user}
else
_ -> :failed
end
end
end
defmodule Argon2Test.MixProject do
use Mix.Project
def project do
[
app: :argon2_test,
version: "0.1.0",
elixir: "~> 1.6",
start_permanent: Mix.env() == :prod,
deps: deps(),
dialyzer: [
plt_add_deps: :transitive,
]
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[extra_applications: [:logger]]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:comeonin, "~> 4.1"},
{:argon2_elixir, "~> 1.2"},
{:dialyxir, "~> 0.5", only: [:dev], runtime: false},
]
end
end
@e-monson
Copy link

I came here from your Stack Overflow question. Did you ever find a way around this? I'm having a very similar error.

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