Bug or caveat? "Loading of Elixir.beam failed: badfile"

1,071 views
Skip to first unread message

Alexei Sholik

unread,
Mar 31, 2014, 11:19:43 AM3/31/14
to elixir-lang-core
Create a file.ex with the following contents:

defmodule Elixir do
end

Then compile it with `elixirc file.ex`. Start IEX shell in the same dir and try calling a function in Elixir. I guess it's a special case that `Elixir == :"Elixir"`, therefore the Elixir.Elixir.beam file in the current directory is ignored. The error message is not very pretty though.

iex(1)> Elixir.hi

=ERROR REPORT==== 31-Mar-2014::18:14:57 ===
Loading of /Users/alco/Documents/git/elixir/bin/../lib/elixir/ebin/Elixir.beam failed: badfile

=ERROR REPORT==== 31-Mar-2014::18:14:57 ===
beam/beam_load.c(1249): Error loading module 'Elixir':
  module name in object code is elixir


=ERROR REPORT==== 31-Mar-2014::18:14:57 ===
Loading of /Users/alco/Documents/git/elixir/bin/../lib/elixir/ebin/Elixir.beam failed: badfile

=ERROR REPORT==== 31-Mar-2014::18:14:57 ===
beam/beam_load.c(1249): Error loading module 'Elixir':
  module name in object code is elixir

** (UndefinedFunctionError) undefined function: Elixir.hi/0
    Elixir.hi()


--
Best regards
Alexei Sholik

José Valim

unread,
Mar 31, 2014, 11:21:28 AM3/31/14
to elixir-l...@googlegroups.com
Bug. We should not let you define a module named Elixir.



José Valim
Skype: jv.ptec
Founder and Lead Developer


--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexei Sholik

unread,
Mar 31, 2014, 11:30:04 AM3/31/14
to elixir-lang-core
Reply all
Reply to author
Forward
0 new messages