diff options
Diffstat (limited to 'test/files/run')
-rwxr-xr-x | test/files/run/bug1220.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/bug1220.scala b/test/files/run/bug1220.scala new file mode 100755 index 0000000000..a992e5f2a5 --- /dev/null +++ b/test/files/run/bug1220.scala @@ -0,0 +1,14 @@ +object Test extends Application { + class QSRichIterable[A](self:Iterable[A]) { + def filterMap[R](f: PartialFunction[A,R]) = + self filter (f.isDefinedAt) map f + } + + object Un { + def unapply(i:int): Option[int] = Some(i) + } + + val richIter = new QSRichIterable(List(0, 1, 2, 3, 4)) + + assert((richIter filterMap {case Un(3) => 7}) == List(7)) +} |