summaryrefslogtreecommitdiff
path: root/test/files/run/t7571.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t7571.scala')
-rw-r--r--test/files/run/t7571.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t7571.scala b/test/files/run/t7571.scala
new file mode 100644
index 0000000000..00b9695168
--- /dev/null
+++ b/test/files/run/t7571.scala
@@ -0,0 +1,12 @@
+class Foo(val a: Int) extends AnyVal {
+ def foo = { {case x => x + a}: PartialFunction[Int, Int]}
+
+ def bar = (new {}).toString
+}
+
+object Test extends App {
+ val x = new Foo(1).foo.apply(2)
+ assert(x == 3, x)
+ val s = new Foo(1).bar
+ assert(s.nonEmpty, s)
+}