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

Compiler warning #46

Open
edescourtis opened this issue Jul 3, 2018 · 2 comments
Open

Compiler warning #46

edescourtis opened this issue Jul 3, 2018 · 2 comments

Comments

@edescourtis
Copy link

edescourtis commented Jul 3, 2018

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)
@chazsconi
Copy link

chazsconi commented Jul 15, 2018

@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

@devstopfix
Copy link

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

devstopfix added a commit to devstopfix/excheck that referenced this issue Aug 7, 2019
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

3 participants