aboutsummaryrefslogblamecommitdiff
path: root/tests/run/t4482.scala
blob: 392861c22ee0d39bb506c0dca26ec88ee429d332 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                            
trait Foo { def i: Int }
trait Bar

case class Spam(i: Int) extends Foo with Bar

object Test {
  def matchParent(p:Any) = p match {
    case f:Foo if f.i == 1 => 1
    case _:Bar => 2
    case _:Foo => 3
  }
  def main(args: Array[String]): Unit = {
    println(matchParent(Spam(3)))
  }
}