From 538e6dfbb5b1d405e1c763b92a5b2cb77eb3aedd Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sun, 6 May 2012 21:50:26 +0200 Subject: Test case closes SI-4568. What's the opposite of regression? Progression! --- test/files/neg/t4568.check | 4 ++++ test/files/neg/t4568.scala | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/files/neg/t4568.check create mode 100644 test/files/neg/t4568.scala 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 -- cgit v1.2.3