summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-05-06 21:50:26 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-05-06 21:50:26 +0200
commit538e6dfbb5b1d405e1c763b92a5b2cb77eb3aedd (patch)
tree08eb25d752d4454c6cdb56db42e622cd679af20c
parent7cac6334d4437ff54c4979799574045501f64135 (diff)
downloadscala-538e6dfbb5b1d405e1c763b92a5b2cb77eb3aedd.tar.gz
scala-538e6dfbb5b1d405e1c763b92a5b2cb77eb3aedd.tar.bz2
scala-538e6dfbb5b1d405e1c763b92a5b2cb77eb3aedd.zip
Test case closes SI-4568.
What's the opposite of regression? Progression!
-rw-r--r--test/files/neg/t4568.check4
-rw-r--r--test/files/neg/t4568.scala13
2 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/t4568.check b/test/files/neg/t4568.check
new file mode 100644
index 0000000000..f94d699486
--- /dev/null
+++ b/test/files/neg/t4568.check
@@ -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
diff --git a/test/files/neg/t4568.scala b/test/files/neg/t4568.scala
new file mode 100644
index 0000000000..8067759262
--- /dev/null
+++ b/test/files/neg/t4568.scala
@@ -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)))
+ }
+ }
+ }
+
+} \ No newline at end of file