summaryrefslogtreecommitdiff
path: root/test/files/pos/virtpatmat_exist_uncurry.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-04-11 15:05:27 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-04-14 11:50:27 +0200
commitd383f458aa5c53629727c5b6abb5134218471543 (patch)
treea9cbdf47f7bcdadd50f3c95f25a805db16c47849 /test/files/pos/virtpatmat_exist_uncurry.scala
parent98a85ccae54195ee17f4b4aa12c22d018fd43bee (diff)
downloadscala-d383f458aa5c53629727c5b6abb5134218471543.tar.gz
scala-d383f458aa5c53629727c5b6abb5134218471543.tar.bz2
scala-d383f458aa5c53629727c5b6abb5134218471543.zip
synth PartialFunction in uncurry
due to interaction with the CPS plugin, can't synth PartialFun during typer (the types don't work out: in PartialFun[T, U @cps[V]], U @cps[V] does not conform to Any, and we can't move the annot from the type arg directly to applyOrElse's result, since then it won't override anything) thus, we face the pain of mangling labeldefs again resetLocalAttrsKeepLabels can't use leaveAlone don't cast matcherror throw, uncurry gets confused uncurry: cast selector valdef's rhs to avoid skolem mismatch NOTE: I'm not happy about this code, but I don't know how to make the clean way (typedMatchAnonFun) compatible with the CPS plugin one avenue to explor would be to introduce PartialFunCPS, which is transformed into a regular PartialFun when T @cps[U] is turned into ControlContext[T, U]
Diffstat (limited to 'test/files/pos/virtpatmat_exist_uncurry.scala')
-rw-r--r--test/files/pos/virtpatmat_exist_uncurry.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/files/pos/virtpatmat_exist_uncurry.scala b/test/files/pos/virtpatmat_exist_uncurry.scala
new file mode 100644
index 0000000000..e017da6343
--- /dev/null
+++ b/test/files/pos/virtpatmat_exist_uncurry.scala
@@ -0,0 +1,6 @@
+object Test {
+ trait Leaf[T] {
+ def collect[U](f: PartialFunction[Leaf[_], U]): List[U]
+ def leaves: List[Leaf[T]] = collect { case l: Leaf[T] => l }
+ }
+} \ No newline at end of file