[erlang-questions] Why Erlang compiler don't check functions in module?

Alex S. <>
Fri Feb 10 13:58:05 CET 2017


> 10 февр. 2017 г., в 13:21, Howld <> написал(а):
> 
> Dear Developers:
>      As a new developer, the result of the compile I hope is clear to indicate the functions in module if exist when I use compiler cmd like "erlc test.erl". But hopeless, if I write code like "elang:spwan(fun test:foo/0)" in erl file, it happens nothing even warning. I think it increases uncertainty with non-English speaking countrie's developers. And if you think so, I will shame on you. What I real want to express is you should have an idea and there is a long way to improve compiler.
> 
> Best blessing!
Hey HowId,
there’s a nifty «xref» tool you can use that does static analysis necessary to detect such cases. Since functions are loaded in runtime through the code server, the analysis is complex enough that it was decided to be left out of the compiler.

You can either use xref module directly, or use your build system’s support for it, if it has such.



More information about the erlang-questions mailing list