diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/bug927.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/pos/bug927.scala b/test/files/pos/bug927.scala new file mode 100644 index 0000000000..6ab932e23b --- /dev/null +++ b/test/files/pos/bug927.scala @@ -0,0 +1,11 @@ +object Test { + + def sum(stream: Stream[int]): int = + stream match { + case Stream.empty => 0 + case Stream.cons(hd, tl) => hd + sum(tl) + } + val str: Stream[int] = Stream.fromIterator(List(1,2,3).elements) + assert(sum(str) == 6) + +} |