@@ -155,7 +155,7 @@ compile(Meta, Module, ModuleAsCharlist, Block, Vars, Prune, E) ->
155
155
put_compiler_modules ([Module | CompilerModules ]),
156
156
{Result , ModuleE , CallbackE } = eval_form (Line , Module , DataBag , Block , Vars , Prune , E ),
157
157
CheckerInfo = checker_info (),
158
- BeamLocation = beam_location (ModuleAsCharlist ),
158
+ { BeamLocation , Forceload } = beam_location (ModuleAsCharlist ),
159
159
160
160
{Binary , PersistedAttributes , Autoload } =
161
161
elixir_erl_compiler :spawn (fun () ->
@@ -215,7 +215,7 @@ compile(Meta, Module, ModuleAsCharlist, Block, Vars, Prune, E) ->
215
215
216
216
compile_error_if_tainted (DataSet , E ),
217
217
Binary = elixir_erl :compile (ModuleMap ),
218
- Autoload = proplists :get_value (autoload , CompileOpts , false ) or load_module ( Module ),
218
+ Autoload = Forceload or proplists :get_value (autoload , CompileOpts , false ),
219
219
spawn_parallel_checker (CheckerInfo , Module , ModuleMap ),
220
220
{Binary , PersistedAttributes , Autoload }
221
221
end ),
@@ -544,10 +544,11 @@ bag_lookup_element(Table, Name, Pos) ->
544
544
545
545
beam_location (ModuleAsCharlist ) ->
546
546
case get (elixir_compiler_dest ) of
547
- Dest when is_binary (Dest ) ->
548
- filename :join (elixir_utils :characters_to_list (Dest ), ModuleAsCharlist ++ " .beam" );
547
+ {Dest , Forceload } when is_binary (Dest ) ->
548
+ {filename :join (elixir_utils :characters_to_list (Dest ), ModuleAsCharlist ++ " .beam" ),
549
+ Forceload };
549
550
_ ->
550
- " "
551
+ { " " , true }
551
552
end .
552
553
553
554
% % Integration with elixir_compiler that makes the module available
@@ -585,16 +586,6 @@ make_module_available(Module, Binary, Loaded) ->
585
586
receive {Ref , ack } -> ok end
586
587
end .
587
588
588
- load_module (Module ) ->
589
- case get (elixir_compiler_info ) of
590
- undefined ->
591
- true ;
592
- {PID , _ } ->
593
- Ref = make_ref (),
594
- PID ! {'load_module?' , self (), Ref , Module },
595
- receive {Ref , Boolean } -> Boolean end
596
- end .
597
-
598
589
% % Error handling and helpers.
599
590
600
591
% % We've reached the elixir_module or eval internals, skip it with the rest
0 commit comments