summaryrefslogtreecommitdiff
path: root/test/files/pos/virtpatmat_castbinder.scala
blob: 53e937e8669907a5a69dbf3d9b2603c148b4cddf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class IntMap[+V]
case class Bin[+T](m: IntMap[T]) extends IntMap[T]
case class Tip[+T](x: T) extends IntMap[T]

trait IntMapIterator[V, T] {
  def valueOf(tip: Tip[V]): T
  def pop: IntMap[V]

  def next: T = 
    pop match {
      case Bin(t@Tip(_)) => {
        valueOf(t)
      }
    }
}