diff options
-rw-r--r-- | src/library/scala/Console.scala | 2 | ||||
-rw-r--r-- | test/files/pos/bug927.scala | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/library/scala/Console.scala b/src/library/scala/Console.scala index 3a4842232b..ff1f0ce392 100644 --- a/src/library/scala/Console.scala +++ b/src/library/scala/Console.scala @@ -178,7 +178,7 @@ object Console { * @param args the parameters used to instantiate the format. * @throws java.lang.IllegalArgumentException */ - def printf(text: String, args: Any*): Unit = format(text, args) + def printf(text: String, args: Any*): Unit = format(text, args: _*) /** * @see <a href="#printf(java.lang.String,scala.Any*)" 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) + +} |