title: Ambiguous imports in Scala
body: <p>I'm writing a small simulation program in Scala. It is actor-based so I've created a file <code>messages.scala</code> that contains all of the messages that are valid in the system. </p>
  
  <p>Outside of this, I have a management component, <code>management.scala</code> and a file that defines the nodes and links classes <code>nodes.scala</code>. Management and node files both <code>import sim.messages._</code> and then management does <code>import sim.nodes._</code> as it needs to be able to instantiate things from that file.</p>
  
  <p>The problem comes with one message type <code>Tick</code> that is used by both <code>management.scala</code> and <code>nodes.scala</code>. Upon compiling the management component, I get:</p>
  
  <pre><code>error: reference to Tick is ambiguous;
  it is imported twice in the same scope by
  import sim.nodes._
  and import sim.messages._
  </code></pre>
  
  <p>I tried removing the import of messages in the management component since they were apparently already imported in to this scope but then they couldn't find them anymore. Ideas?</p>