aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/i1365.scala
blob: e7d47da4b759499b477e444e0620ee292c71a146 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import scala.collection.mutable.ArrayBuffer

trait Message[M]
class Script[S] extends ArrayBuffer[Message[S]] with Message[S]

class Test[A] {
  def f(cmd: Message[A]): Unit = cmd match {
    case s: Script[_] => s.iterator.foreach(x => f(x))
  }
  def g(cmd: Message[A]): Unit = cmd match {
    case s: Script[z] => s.iterator.foreach(x => g(x))
  }
}