cannot define module because it is currently being defined

722 views
Skip to first unread message

Alex Shneyderman

unread,
Mar 23, 2014, 4:46:27 PM3/23/14
to elixir-l...@googlegroups.com

I am having a problem compiling a project:

16:42:59 goulash_control > mix compile 

== Compilation error on file lib/goulash/control.ex ==

** (CompileError) lib/goulash/control.ex:1: cannot define module Goulash.Control because it is currently being defined

    (stdlib) erl_eval.erl:569: :erl_eval.do_apply/6

    (elixir) src/elixir.erl:140: :elixir.eval_forms/4

    (elixir) src/elixir_lexical.erl:17: :elixir_lexical.run/2


16:43:04 goulash_control > mix -v

Elixir 0.12.5

The module's in question source is below:

defmodule Goulash.Control do

    use Application.Behaviour


    def start do

        :application.start(:elixir)

        :application.start(:goulash_control)

    end


    def start(_type, _args) do

        :supervisor.start_link({:local, Goulash.ControlSup}, Goulash.ControlSup, [])

    end

    

end


I do not exactly understand what the problem is. Any hints are appreciated.

Cheers,
Alex.


José Valim

unread,
Mar 23, 2014, 4:53:30 PM3/23/14
to elixir-l...@googlegroups.com
Do you have, by any chance, another file defining the same module?



--


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

Alex Shneyderman

unread,
Mar 23, 2014, 5:03:49 PM3/23/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
no. I am in a habbit of defining module per .ex file so no I am pretty sure there is no such thing. I also checked defrecord no duplcates there either.
Is there a way to make mix a bit more verbose so I can see exactly what it confuses for the given module? 

Alex Shneyderman

unread,
Mar 23, 2014, 5:29:28 PM3/23/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
hmm, sorry a file move was over-ridden by an old sublime buffer.
all is good now. 

José Valim

unread,
Mar 23, 2014, 6:12:31 PM3/23/14
to elixir-l...@googlegroups.com
Alex, we probably should say where the other module and file is being defined. Can you please open up an issue so we take care of that? Thanks!



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


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

Reply all
Reply to author
Forward
0 new messages