"No function clause matching X" errors are generally quite unclear. It'd be nice if all failing function clauses were shown, and even nicer if these clauses were diffed against the actual arguments.I don't know much about the internals of Elixir, but I don't think a list of function clauses is available at runtime. A possible workaround might be to recompile the module in question, hooking into @on_definition to record the clauses.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/cc7322d5-61e9-46bf-b3c6-5ca1a3e64e61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
There is an open issue to provide such feature. It is actually quite complex to implement because you need to reimplement the pattern matching algorithm, except it should go step by step and give feedback along the way. It is also something you likely don't want to run in production, so we need a way to disable such checks when building releases or similar.
On Wed, Feb 1, 2017 at 12:26 PM, Bob <ben.bob....@gmail.com> wrote:
"No function clause matching X" errors are generally quite unclear. It'd be nice if all failing function clauses were shown, and even nicer if these clauses were diffed against the actual arguments.I don't know much about the internals of Elixir, but I don't think a list of function clauses is available at runtime. A possible workaround might be to recompile the module in question, hooking into @on_definition to record the clauses.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
Just wondering, is this necessary because it's impossible to list the function clauses or because there's no straightforward way to turn a function clause into one hand of a pattern match?
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4Lsd7YPArUjFXjAsbxm%2BQ-CxxvBwOJhSZ%3DJQqU%2BO0svKw%40mail.gmail.com.