Skip to content

Commit a3754e3

Browse files
author
José Valim
committed
Do not show aliases and import warnings when code cannot compile
Signed-off-by: José Valim <[email protected]>
1 parent 337c040 commit a3754e3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/elixir/src/elixir_lexical.erl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ run(File, Dest, Callback) ->
1313
case elixir_compiler:get_opt(internal) of
1414
false ->
1515
{ok, Pid} = ?tracker:start_link(Dest),
16-
try
17-
Callback(Pid)
16+
try Callback(Pid) of
17+
Res ->
18+
warn_unused_aliases(File, Pid),
19+
warn_unused_imports(File, Pid),
20+
Res
1821
after
19-
warn_unused_aliases(File, Pid),
20-
warn_unused_imports(File, Pid),
21-
unlink(Pid), ?tracker:stop(Pid)
22+
unlink(Pid),
23+
?tracker:stop(Pid)
2224
end;
2325
true ->
2426
Callback(nil)

0 commit comments

Comments
 (0)