excheck
excheck copied to clipboard
Compiler warning
I keep getting this warning how to get this resolved?
All I have is a simple module with this:
use ExUnit.Case, async: false
use ExCheck
warning: this clause cannot match because a previous clause at line 1 always matches
Env:
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.6.4) - press Ctrl+C to exit (type h() ENTER for help)
@edescourtis It seems the problem is caused by use ExCheck
doing a use ExUnit.Callbacks
which maybe fails because it has already been imported by use ExUnit.Case
.
I worked around this by replacing use ExCheck
by the following. This does the same but with the two lines commented - maybe in some cases use ExCheck.Generator
is also needed by in my case it wasn't so I removed it also.
import ExCheck.Predicate
import ExCheck.Statement
# use ExCheck.Generator
# use ExUnit.Callbacks
import :triq_dom, except: [atom: 0], only: :functions
setup(context) do
# Redirect all output first to IOServer process before test starts
ExCheck.IOServer.redirect(self())
{:ok, context}
end
We can remove use ExUnit.Callbacks
from lib/excheck.ex line 14. The test cases must either:
use ExUnit.Case
use ExCheck
or
use ExUnit.Callbacks
use ExCheck