@@ -201,6 +201,32 @@ defmodule Mix.Tasks.Compile.ElixirTest do
201201 end )
202202 end
203203
204+ test "compiles dependent changed modules without beam files" do
205+ in_fixture ( "no_mixfile" , fn ->
206+ File . write! ( "lib/b.ex" , """
207+ defmodule B do
208+ def a, do: A.__info__(:module)
209+ end
210+ """ )
211+
212+ Mix.Tasks.Compile.Elixir . run ( [ "--verbose" ] )
213+ assert_received { :mix_shell , :info , [ "Compiled lib/a.ex" ] }
214+ assert_received { :mix_shell , :info , [ "Compiled lib/b.ex" ] }
215+
216+ assert File . regular? ( "_build/dev/lib/sample/ebin/Elixir.A.beam" )
217+ assert File . regular? ( "_build/dev/lib/sample/ebin/Elixir.B.beam" )
218+
219+ Code . put_compiler_option ( :ignore_module_conflict , true )
220+ Code . compile_file ( "lib/b.ex" )
221+ File . touch! ( "lib/a.ex" , { { 2038 , 1 , 1 } , { 0 , 0 , 0 } } )
222+
223+ Mix.Tasks.Compile.Elixir . run ( [ "--verbose" ] )
224+ assert_received { :mix_shell , :info , [ "Compiled lib/a.ex" ] }
225+ end )
226+ after
227+ Code . put_compiler_option ( :ignore_module_conflict , false )
228+ end
229+
204230 test "compiles dependent changed modules even on removal" do
205231 in_fixture ( "no_mixfile" , fn ->
206232 File . write! ( "lib/a.ex" , "defmodule A, do: B.module_info()" )
0 commit comments