diff options
Diffstat (limited to 'test/pending/neg/t6680c.scala')
-rw-r--r-- | test/pending/neg/t6680c.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/pending/neg/t6680c.scala b/test/pending/neg/t6680c.scala new file mode 100644 index 0000000000..f69663a71b --- /dev/null +++ b/test/pending/neg/t6680c.scala @@ -0,0 +1,17 @@ +package s + +trait Stream[+A] +case class Unfold[S,+A](s: S, f: S => Option[(A,S)]) extends Stream[A] + +object Stream { + def fromList[A](a: List[A]): Stream[A] = + Unfold(a, (l:List[A]) => l.headOption.map((_,l.tail))) +} + +object Test { + def main(args: Array[String]): Unit = { + val res = Stream.fromList(List(1,2,3,4)) + + res match { case Unfold(s, f) => f("a string!") } + } +} |