aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/desugar.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-06 14:39:30 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-06 14:39:30 +0100
commite74b6316b93993e3c798bd9df45d83fc0665c52e (patch)
treed5e37a01eb53d11a9a928721c93ee1af188054de /tests/pos/desugar.scala
parent554ac428ede1c7a337b507a2e8b29c1671c7d2ee (diff)
downloaddotty-e74b6316b93993e3c798bd9df45d83fc0665c52e.tar.gz
dotty-e74b6316b93993e3c798bd9df45d83fc0665c52e.tar.bz2
dotty-e74b6316b93993e3c798bd9df45d83fc0665c52e.zip
Fixing expansion and merge companion defs.
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