diff options
Diffstat (limited to 'tests/run/value-class-partial-func-depmet.scala')
-rw-r--r-- | tests/run/value-class-partial-func-depmet.scala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run/value-class-partial-func-depmet.scala b/tests/run/value-class-partial-func-depmet.scala new file mode 100644 index 000000000..f8d2a16e7 --- /dev/null +++ b/tests/run/value-class-partial-func-depmet.scala @@ -0,0 +1,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 |