diff options
author | Martin Odersky <odersky@gmail.com> | 2016-01-29 21:48:55 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-02-19 14:02:17 +0100 |
commit | 8441de7a907996361a78d744d3364cee3d558f84 (patch) | |
tree | a553bc1c18466324d0f2898af5c9c4d48a4c5fe4 /tests/neg | |
parent | 1d585f1172d563051c0710008568b3b53728281f (diff) | |
download | dotty-8441de7a907996361a78d744d3364cee3d558f84.tar.gz dotty-8441de7a907996361a78d744d3364cee3d558f84.tar.bz2 dotty-8441de7a907996361a78d744d3364cee3d558f84.zip |
Allow Named Arguments in TypeArgs
Lets one also pass named arguments to methods.
Diffstat (limited to 'tests/neg')
-rw-r--r-- | tests/neg/named-params.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/neg/named-params.scala b/tests/neg/named-params.scala index c1f055e10..9ef4ed066 100644 --- a/tests/neg/named-params.scala +++ b/tests/neg/named-params.scala @@ -19,4 +19,16 @@ object Test { val c3 = new C[Elem = String, Value = Int]("B") val c4 = new C[Elem = String]("C") val x2: c2.Elem = c2.elem + + val c5 = new C[Elem1 = String, Value0 = Int]("B") // error // error + + def d2[E, V](x: E) = new C[Elem = E, Value = V](x) + + val dup = d2[E = Int, V = String, E = Boolean](2) // error + val z1 = d2[Elem = Int, Value = String](1) // error // error + val z2 = d2[Value = String, Elem = Int](1) // error // error + val z3 = d2[Elem = Int](1) // error + val z4 = d2[Value = Int]("AAA") // error + val z5 = d2[Elem = Int][Value = String](1) //error // error + } |