Mix does warn about it when you try to call a function from a non-existent
module:

$ mix compile
Compiling 1 file (.ex)
warning: function This.Module.Does.Not.Exist.foo/0 is undefined (module
This.Module.Does.Not.Exist is not available)

It does so because `mix xref` runs automatically on each compilation. The
base Elixir compiler doesn't perform such checks.

On Fri, Mar 1, 2019 at 4:08 PM Jan Ziniewicz <[email protected]>
wrote:

>
> Hi everyone,
>
> Please take a look at this line of code:
>
> alias This.Module.Does.Not.Exist
>
> In my opinion compiler should emit an error or at least warning when
> trying to alias a non existent module? However, this line is perfectly
> valid  piece of code.
> Asking just out of curiosity, is this a bug or a feature?
>
> Best, Jan
>
> --
> 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/3bc43a69-ad37-4323-be65-f7ddac4aaead%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/3bc43a69-ad37-4323-be65-f7ddac4aaead%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/CAAPY6ePFexxHpxBGmR4Bjxa_xQgXAibTsEnAU97S%2BrF1udPPkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to