Yes, check_behaviours_and_impls is the way to go! It was named planning
exactly for this case. Once you start working on there, you will notice
part of the code already computes the callbacks from behaviours so we
should avoid computing those things twice. So basically, we would get the
behaviour data, validate it, and then check the implementations.

Notice also that once you move the warning to Elixir, you will need to add
clauses to elixir_erl_compiler:handle_file_warning to make sure the warning
is not printed twice: once by Elixir, another one by Erlang.

PS: Discussions related to issues can be kept in the issues themselves. :)



*José Valimwww.plataformatec.com.br
<http://www.plataformatec.com.br/>Founder and Director of R&D*

On Fri, Oct 6, 2017 at 5:29 AM, Alexis Brodeur <[email protected]>
wrote:

> After a bit of thinking, I would obviously implement the checks after the
> expansion phase, since macros may define behaviour and callbacks, but
> should I do this check before the *:elixir_erl.attributes_form/3*
> function, or should I do it on the *Elixir* side in the
> *Elixir.Module.check_behaviours_and_impls/4* function ?
> I would personally go for the latter, but I am more inclined to follow
> suggestions from more experienced contributors.
>
> On Thursday, October 5, 2017 at 8:54:13 PM UTC-4, Alexis Brodeur wrote:
>>
>> I'm trying to work in moving the *behaviour* lint checks into Elixir as
>> per #5800 <https://github.com/elixir-lang/elixir/issues/5800>.
>>
>> Since module attributes are not expanded at compile time by the compiler
>> in *elixir_expand.erl*, I am at a road block as to where to implement
>> the lint checks.
>>
>> From what I gather, *attributes* are persisted at compile time in* ETS *and
>> fetched during the compilation phase in *elixir_module:compile*
>> <https://github.com/elixir-lang/elixir/blob/master/lib/elixir/src/elixir_module.erl#L82>,
>> and are then converted to *AST* by the *elixir_erl:attributes_form*
>> <https://github.com/elixir-lang/elixir/blob/master/lib/elixir/src/elixir_erl.erl#L415>
>>  function.
>>
> --
> 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/4dd1b207-0040-402b-a8c7-
> 8c2bc97a2f7c%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/4dd1b207-0040-402b-a8c7-8c2bc97a2f7c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> 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/CAGnRm4KZpQwFuKAFFb-wqE2Tj6O1ccgYVBD97Onchp0ksKXvqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to