aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/desugar.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/desugar.scala')
-rw-r--r--tests/pos/desugar.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pos/desugar.scala b/tests/pos/desugar.scala
index ffd114652..ca52ac6ec 100644
--- a/tests/pos/desugar.scala
+++ b/tests/pos/desugar.scala
@@ -9,5 +9,19 @@ object desugar {
def foo0(first: Int, second: Int = 2, third: Int = 3) = first + second
def foo1(first: Int, second: Int = 2)(third: Int = 3) = first + second
def foo2(first: Int)(second: Int = 2)(third: Int = 3) = first + second
+
+ object lists {
+ trait List[+T] {
+ def head: T
+ def tail: List[T]
+ }
+
+ case class Cons[+T](val head: T, val tail: List[T]) extends List[T]
+
+ object Cons {
+ def apply[T](head: T): Cons[T] = apply(head, Nil)
+ }
+ case object Nil extends List[Nothing]
+ }
} \ No newline at end of file