title: Scala 2.7 : reference is ambiguous (imported twice)
body: <p>In Scala 2.7, I want to use a method as a parameter of another method of the same class.</p>
  
  <p>I have a class and objects which are companions:</p>
  
  <pre><code>class mM(var elem:Matrix){
      //apply a function on a dimension rows (1) or cols (2) 
      def app(func:Iterable[Double]=&gt;Double)(dim : Int) : Matrix = {
          ...
      }
      //utility function
      def logsumexp(): Double = {...}
  }
  
  object mM{
      def apply(elem:Matrix):mM={new mM(elem)}
      def logsumexp(elem:Iterable[Double]): Double ={
           this.apply(elem.asInstanceOf[Matrix]).logsumexp()
      }
  }
  </code></pre>
  
  <p>Normally I use logsumexp like this <code>mM(matrix).logsumexp</code> but if want to apply it to the rows I can't use <code>mM(matrix).app(mM.logsumexp)(1)</code>, I get the error:</p>
  
  <pre><code>error: reference to mM is ambiguous;
  it is imported twice in the same scope by
  import mM
  and import mM
  </code></pre>
  
  <p>What is the most elegant solution ? Should I change logsumexp() to another class ? </p>
  
  <p>Thanks,=)</p>