I have the following minimal module (the smallest possible module generated by Elixir):
-file("lib/darwin/ex_to_erl.ex", 0).
-module('Elixir.MyModule').
-compile([no_auto_import]).
-export(['__info__'/1]).
-spec '__info__'(attributes | compile | functions |
macros | md5 | module | deprecated) -> any().
'__info__'(module) -> 'Elixir.MyModule';
'__info__'(functions) -> [];
'__info__'(macros) -> [];
'__info__'(Key = attributes) ->
erlang:get_module_info('Elixir.MyModule', Key);
'__info__'(Key = compile) ->
erlang:get_module_info('Elixir.MyModule', Key);
'__info__'(Key = md5) ->
erlang:get_module_info('Elixir.MyModule', Key);
'__info__'(deprecated) -> [].
I don’t understand why :erlang.get_module_info/2
works the way it does:
iex> :erlang.get_module_info(MyModule, :attributes)
[vsn: [147295737053399631997724789219256487707]]
I was expecting a list that included the :file
attribute. Why does it only return the module version?