Skip to content

Commit d37a10b

Browse files
author
José Valim
committed
Purge and delete modules before compiling them
Signed-off-by: José Valim <[email protected]>
1 parent 5d75c5c commit d37a10b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/mix/lib/mix/compilers/elixir.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ defmodule Mix.Compilers.Elixir do
157157

158158
defp remove_stale_entries([{beam, module, source, _d, _f} = entry|t], changed, removed, acc) do
159159
if source in changed do
160+
atom = String.to_atom(module)
160161
_ = File.rm(beam)
162+
_ = :code.purge(atom)
163+
_ = :code.delete(atom)
161164
remove_stale_entries(t, changed, [module|removed], acc)
162165
else
163166
remove_stale_entries(t, changed, removed, [entry|acc])

0 commit comments

Comments
 (0)