title: scala and abstract type "unboxing"
body: <p>Given classes</p>
  
  <pre><code>object A {
    type URLT = String
  }
  
  case class A(url : URLT)
  
  class ForeignStreamWriter {
    def writeString(str: String) {}
  }
  
  trait WriterA {
  
    val writer : ForeignStreamWriter
  
    def write(src: A) {
      writer.write(src.url)
    }
  }
  </code></pre>
  
  <p>how can I tell the compiler that I'm working with String - not URLT - in <strong>writer.write(src.url)</strong>? I can not modify signature of ForeignStreamWriter.</p>
  
  <p><strong>UPD</strong></p>
  
  <p>As for now I found the only solution</p>
  
  <pre><code>  def write(src: A) {
      writer.write(src.url.asInstanceOf[String])
    }
  </code></pre>
  
  <p>but I don't really like it.</p>