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

no function clause matching in Happy.HappyPath.happy_match_eq/1 #8

Open
OvermindDL1 opened this issue Aug 25, 2016 · 2 comments
Open

Comments

@OvermindDL1
Copy link
Contributor

Given this reduced test:

{:ok, str} when is_binary(str) = tuple when is_tuple(tuple) = get_a_string_or_whatever()

It gives a compile-time error of:

 ** (FunctionClauseError) no function clause matching in Happy.HappyPath.happy_match_eq/1
    (happy) lib/happy/happy_path.ex:164: Happy.HappyPath.happy_match_eq({:when, [line: 8], [{:=, [line: 8], [{:is_binary, [line: 8], [{:str, [line: 8], nil}]}, {:tuple, [line: 8], nil}]}, {:=, [line: 8], [{:is_tuple, [line: 8], [{:tuple, [line: 8], nil}]}, {:get_a_string_or_whatever, [line: 8], []}]}]})
    (happy) lib/happy/happy_path.ex:145: Happy.HappyPath.happy_match/1
    (happy) lib/happy/happy_path.ex:112: Happy.HappyPath.happy_match?/1
    (elixir) lib/enum.ex:2511: Enum.do_any?/2
    (happy) lib/happy/happy_path.ex:88: Happy.HappyPath.make_happy/2
    (happy) expanding macro: Happy.happy_path!/2
    (my_server) web/controllers/index_controller.ex:7: MyServer.IndexController.index/2
    (elixir) lib/kernel/parallel_compiler.ex:116: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
@vic
Copy link
Owner

vic commented Oct 13, 2016

Hey, I've just released happy_with it has the same features as happy_path but uses with underneath, so if this issue is really a concern for you, you might want to try it, it's way simpler as it sits on top of with.

@OvermindDL1
Copy link
Contributor Author

Already have it actually, and awesome as usual! ^.^

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

2 participants