blob: 12ff64ed369a52b19ee0220a89ead00344b15c42 (
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]) {
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
|