title: Scala overloading not choosing most specific method
body: <p>Having Java classes:</p>
  
  <pre><code>class abstract Exp
  class ExpAdd extends Exp
  class ExpSub extends Exp
  </code></pre>
  
  <p>and Scala methods:</p>
  
  <pre><code>def interpret(e: ExpAdd) = interpret(e.left_arg) + interpret(e.right_arg)
  def interpret(e: ExpSub) = interpret(e.left_arg) - interpret(e.right_arg)
  
  def interpret(exp: Exp) = exp match {
    case e : ExpAdd = interpret(e)
    case e : ExpSub = interpret(e)
  }
  </code></pre>
  
  <p>How to <strong>refactor</strong> the code to make <strong>adding new Exps easier</strong>? I thought interpret(Exp) wouldn't be used at all as two other are more specific and</p>
  
  <blockquote>
    <p>If more than one member method is both accessible and applicable to a
    method invocation, it is necessary to choose one to provide the
    descriptor for the run-time method dispatch. The Java programming
    language uses the rule that the most specific method is chosen.</p>
  </blockquote>
  
  <p>however that seems not to be the case in Scala. I also tried removing interpret(Exp) but compiler didn't like it. That's why I used case clause... is there any way to make overloading work as expected? or maybe some workaround?</p>