aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg-with-implicits/t4568.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/neg-with-implicits/t4568.scala')
-rw-r--r--tests/untried/neg-with-implicits/t4568.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/untried/neg-with-implicits/t4568.scala b/tests/untried/neg-with-implicits/t4568.scala
new file mode 100644
index 000000000..6fda28736
--- /dev/null
+++ b/tests/untried/neg-with-implicits/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)))
+ }
+ }
+ }
+
+}