aboutsummaryrefslogtreecommitdiff
path: root/tests/run/value-class-partial-func-depmet.scala
blob: f8d2a16e73c5471daccbeaa319fef802b0f70bf6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class C
class A { class C }

object Test {
  def main(args: Array[String]): Unit = {
    val a = new A

    new VC("").foo(a)
  }
}

class VC(val a: Any) extends AnyVal {
   def foo(a: A) = {
     val pf: PartialFunction[a.C, Any] = { case x => x }
     (pf: PartialFunction[Null, Any]).isDefinedAt(null)
   }
}

// 2.11.0-M6
// test/files/run/value-class-partial-func-depmet.scala:14: error: overriding method applyOrElse in trait PartialFunction of type [A1 <: a.C, B1 >: Any](x: A1, default: A1 => B1)B1;
//  method applyOrElse has incompatible type
//      val pf: PartialFunction[a.C, Any] = { case x => x }
//                                          ^
// one error found