title: How to reference outer object from inner class in Scala
body: <p>Consider this code (which is kind of type safe units):</p>
  
  <pre><code>abstract class UnitsZone {
     type ConcreteUnit &lt;: AbstractUnit
  
     abstract class AbstractUnit(val qty: Int) {
       SOME_ABSTRACT_MEMBERS
       def +(that: ConcreteUnit): ConcreteUnit = POINT_OF_INTEREST.apply(this.qty + that.qty)
       def apply(param: Int) = SOME_IMPLEMENTATION
     }
  
     def apply(qty: Int): ConcreteUnit
  }
  
  object Imperial extends UnitsZone {
    type ConcreteUnit = Pound
  
    class Pound(override val qty: Int) extends AbstractUnit(qty) {
      CONCRETE_MEMBERS_HERE
    }
  
    def apply(qty: Int) = new Pound(qty)
  }
  </code></pre>
  
  <p>To make the whole thing works I need to invoke <code>apply</code> method of an outer object with respect to inheritance (marked as <strong>POINT_OF_INTEREST</strong> in the above code). With this in mind I dare to ask several questions:</p>
  
  <ol>
  <li>Is there any way to do it?</li>
  <li>If there are many, what are pros and cons for each one?</li>
  <li>If you think the whole thing is wrong, what is your right way to implement such functionality?</li>
  </ol>