@@ -59,13 +59,21 @@ eval_forms(Forms, Line, Vars, S) ->
5959
6060 % % Pass { native, false } to speed up bootstrap
6161 % % process when native is set to true
62- { module (Form , S # elixir_scope .file , [{native ,false }], true , fun (_ , _ ) ->
62+ { module (Form , S # elixir_scope .file , [{native ,false }], true , fun (_ , Binary ) ->
6363 Res = Module :Fun (S # elixir_scope .module , Args ),
6464 code :delete (Module ),
65- case code :soft_purge (Module ) of
66- true -> return_module_name (I );
67- false -> ok
65+
66+ % % If we have labeled locals, anonymous functions
67+ % % were created and therefore we cannot ditch the
68+ % % module
69+ case beam_lib :chunks (Binary , [labeled_locals ]) of
70+ { ok , { _ , [{ labeled_locals , []}] } } ->
71+ code :purge (Module ),
72+ return_module_name (I );
73+ _ ->
74+ ok
6875 end ,
76+
6977 Res
7078 end ), FS }.
7179
@@ -162,7 +170,7 @@ core_main() ->
162170 " lib/elixir/lib/kernel.ex" ,
163171 " lib/elixir/lib/keyword.ex" ,
164172 " lib/elixir/lib/list.ex" ,
165- " lib/elixir/lib/kernel/typespec.ex" ,
173+ " lib/elixir/lib/kernel/typespec.ex" ,
166174 " lib/elixir/lib/module.ex" ,
167175 " lib/elixir/lib/record.ex" ,
168176 " lib/elixir/lib/record/extractor.ex" ,
0 commit comments