summaryrefslogblamecommitdiff
path: root/test/files/neg/t0528neg.scala
blob: d19bdac73008ac241606e241e365db3156c6c0fa (plain) (tree)
1
2
3
4
5
6
7
8
9




                                             
                                  


                                                
                        




                                                                                
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 App {
  val x: RichStr = new RichStr

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