You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compilation doesn't fail for warning: function/x is undefined(module is not available or is yet to be defined) with --warnings-as-errors as enabled #11648
Erlang/OTP 22 [erts-10.7.2.4] [source] [64-bit] [smp:48:48] [ds:48:48:10] [async-threads:1]
Interactive Elixir (1.10.4) - press Ctrl+C to exit (type h() ENTER for help)
Operating system: Red Hat Enterprise Linux 7.5
Current behavior
An umbrella application with app common and sim are created and compiled successfully
Add calling of Sim.hello in Common.hello function
Compiling from umbrella root
$ mix compile --warnings-as-errors
==> common
Compiling 1 file (.ex)
warning: Sim.hello/0 is undefined (module Sim is not available or is yet to be defined)
lib/common.ex:17: Common.hello/0
Generated common app
==> sim
Compiling 1 file (.ex)
Generated sim app
$ echo $?
0
Compiling the app in standalone doesn't fail either
[common]$ mix compile --warnings-as-errors
Compiling 1 file (.ex)
warning: Sim.hello/0 is undefined (module Sim is not available or is yet to be defined)
lib/common.ex:17: Common.hello/0
Generated common app
[common]$ echo $?
0
Expected behavior
The compiler should've failed similar to when an unused function is used.
$ mix compile --warnings-as-errors
==> common
Compiling 1 file (.ex)
warning: function foo/0 is unused
lib/common.ex:20
warning: Sim.hello/0 is undefined (module Sim is not available or is yet to be defined)
lib/common.ex:17: Common.hello/0
Compilation failed due to warnings while using the --warnings-as-errors option
$ echo $?
1