Permalink
Browse files

Test case closes SI-4568.

What's the opposite of regression? Progression!
  • Loading branch information...
retronym committed May 6, 2012
1 parent 7cac633 commit 538e6dfbb5b1d405e1c763b92a5b2cb77eb3aedd
Showing with 17 additions and 0 deletions.
  1. +4 −0 test/files/neg/t4568.check
  2. +13 −0 test/files/neg/t4568.scala
@@ -0,0 +1,4 @@
+t4568.scala:8: error: recursive method isSubListOf needs result type
+ case h :: t => y.contains(h) && (t.isSubListOf(y.drop(y.indexOf(h) + 1)))
+ ^
+one error found
View
@@ -0,0 +1,13 @@
+object SubList {
+ implicit def sublistable[A](x: List[A]) = new SubListable(x)
+
+ class SubListable[A](x: List[A]) {
+ def isSubListOf(y: List[A]) = {
+ x match {
+ case Nil => true
+ case h :: t => y.contains(h) && (t.isSubListOf(y.drop(y.indexOf(h) + 1)))
+ }
+ }
+ }
+
+}

0 comments on commit 538e6df

Please sign in to comment.