aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-05 18:33:26 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-05 19:00:40 +0100
commit78b57e3c5a2ca0c15729e6f6a3e43c718028754e (patch)
tree0d3fc16be40efa3178c4a28450a39475395c98ee /tests/pos
parentcd28a05fa16b5b2cf3569f0ab0a8c9c685e41bf1 (diff)
downloaddotty-78b57e3c5a2ca0c15729e6f6a3e43c718028754e.tar.gz
dotty-78b57e3c5a2ca0c15729e6f6a3e43c718028754e.tar.bz2
dotty-78b57e3c5a2ca0c15729e6f6a3e43c718028754e.zip
Fixes to lifting
Plus more commenting of Desugar
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/nameddefaults.scala30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/pos/nameddefaults.scala b/tests/pos/nameddefaults.scala
index 4c08e62ef..671f14a07 100644
--- a/tests/pos/nameddefaults.scala
+++ b/tests/pos/nameddefaults.scala
@@ -30,4 +30,34 @@ object nameddefaults {
foo(first = x, third = y)
foo(x, third = y)
+
+// The same thing, but for classes
+
+ class C(first: Int, second: Int = 2, third: Int = 3) {}
+
+ new C(1, 2, 3)
+
+ new C(1, 2)
+
+ new C(1)
+
+ // named and missing arguments
+
+ new C(first = 1, second = 3)
+
+ new C(second = 3, first = 1)
+
+ new C(first = 2, third = 3)
+
+ new C(2, third = 3)
+
+ // same but with non-idempotent expressions
+
+ new C(first = x, second = y)
+
+ new C(second = x, first = y)
+
+ new C(first = x, third = y)
+
+
}