happy
happy copied to clipboard
no function clause matching in Happy.HappyPath.happy_match_eq/1
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
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.
Already have it actually, and awesome as usual! ^.^