When erlang abstract code is compiled to the erlang core code there are 
explicit catch-all clauses added to case expressions, that raise the unmatched 
error added (function clauses are compiled to case at that point as well). We 
could think about doing something similar in the current compiler, although it 
might be one of the things that would be made simpler if elixir compiled to 
core directly.

Michał.

On 1 Feb 2017, 12:34 +0100, José Valim <[email protected]>, wrote:
> 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.
>
>
>
>
> José Valim
> www.plataformatec.com.br
> Skype: jv.ptec
> Founder and Director of R&D
>
> > On Wed, Feb 1, 2017 at 12:26 PM, Bob <[email protected]> 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 [email protected].
> > > 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.
>
> --
> 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 [email protected].
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/884f06dd-e823-4a91-a5e0-fc53e06d6672%40Spark.
For more options, visit https://groups.google.com/d/optout.

Reply via email to