summaryrefslogblamecommitdiff
path: root/test/files/neg/t0528neg.scala
blob: 30d20c95b177dfa41bb0c02693481272490e926b (plain) (tree)
1
2
3
4
5
6




                                             
                                  








                                                                                
trait Sequ[+A] {
  def toArray: Array[T forSome {type T <: A}]
}

class RichStr extends Sequ[Char] {
  // override to a primitive array
  def toArray: Array[Char] = new Array[Char](10)
}

object Foo extends Application {
  val x: RichStr = new RichStr

  println(x.toArray) // call directly
  println((x: Sequ[Char]).toArray) // calling through the bridge misses unboxing
}