From 23e5428008fc88377e59a1a5c20d5476c586d62e Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 18 Feb 2010 05:40:27 +0000 Subject: Tighter pattern matching hits the street. is final and does not conform to the pattern, it will no longer compile. See all the exciting things you can no longer do: "bob".reverse match { case Seq('b', 'o', 'b') => true } // denied! "bob".toArray match { case Seq('b', 'o', 'b') => true } // rejected! final class Dunk def f3(x: Dunk) = x match { case Seq('b', 'o', 'b') => true } // uh-uh! And so forth. Review by odersky. --- test/files/run/withIndex.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/files/run/withIndex.scala') diff --git a/test/files/run/withIndex.scala b/test/files/run/withIndex.scala index 3b9c9e84e5..910b1f1f9e 100644 --- a/test/files/run/withIndex.scala +++ b/test/files/run/withIndex.scala @@ -3,7 +3,7 @@ object Test { val ary: Array[String] = Array("a", "b", "c") val lst: List[String] = List("a", "b", "c") val itr: Iterator[String] = lst.iterator - val str: Stream[String] = Stream.fromIterator(lst.iterator) + val str: Stream[String] = lst.iterator.toStream Console.println(ary.zipWithIndex.toList) Console.println(lst.zipWithIndex.toList) -- cgit v1.2.3