summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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