diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-04 17:27:10 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-03-04 18:28:21 +0100 |
commit | 353a4d9f17b91d09dea3c9090c7a21e267372abe (patch) | |
tree | 08e1541da2f277c17da167ee6b9758a3f08e5f90 /tests/neg | |
parent | 06d3f7aefa620ce006008955203d7f8f8dc7b605 (diff) | |
download | dotty-353a4d9f17b91d09dea3c9090c7a21e267372abe.tar.gz dotty-353a4d9f17b91d09dea3c9090c7a21e267372abe.tar.bz2 dotty-353a4d9f17b91d09dea3c9090c7a21e267372abe.zip |
Drop named type parameters in classes
Drop the [type T] syntax, and what's associated to make it work.
Motivation: It's an alternative way of doing things for which there seems
to be little need. The implementation was provisional and bitrotted during
the various iterations to introduce higher-kinded types. So in the end the
complxity-cost for language and compiler was not worth the added benefit
that [type T] parameters provide.
Noe that we still accept _named arguments_ [A = T] in expressions; these are useful
for specifying some parameters and letting others be inferred.
Diffstat (limited to 'tests/neg')
-rw-r--r-- | tests/neg/namedTypeParams.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/neg/namedTypeParams.scala b/tests/neg/namedTypeParams.scala new file mode 100644 index 000000000..75bb1cd7e --- /dev/null +++ b/tests/neg/namedTypeParams.scala @@ -0,0 +1,12 @@ +class C[T] +class D[type T] // error: identifier expected, but `type` found + +object Test { + + val x: C[T = Int] = // error: ']' expected, but `=` found // error + new C[T = Int] // error: ']' expected, but `=` found // error + + class E extends C[T = Int] // error: ']' expected, but `=` found // error + class F extends C[T = Int]() // error: ']' expected, but `=` found // error + +} |