aboutsummaryrefslogtreecommitdiff
path: root/tests/pickling
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-12-01 12:32:59 +0100
committerMartin Odersky <odersky@gmail.com>2015-12-06 16:09:19 +0100
commitdf00eb195d86a3d1425029f2f2436029a757ee5d (patch)
tree8ecba17ee7babf69f3dbe18f960c21abb95a412d /tests/pickling
parent4c8db87e499e3a0f56a89ed0824b27230db32997 (diff)
downloaddotty-df00eb195d86a3d1425029f2f2436029a757ee5d.tar.gz
dotty-df00eb195d86a3d1425029f2f2436029a757ee5d.tar.bz2
dotty-df00eb195d86a3d1425029f2f2436029a757ee5d.zip
Disallow existentially bound parameters as type parameters
Done in order to keep the basics as simple as possible. Treating existentially bound parameters as still instantiatable type parameters does not seem to add anything fundamental, and makes the type system less regular.
Diffstat (limited to 'tests/pickling')
-rw-r--r--tests/pickling/partialApplications.scala24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/pickling/partialApplications.scala b/tests/pickling/partialApplications.scala
index f517011b9..c4c4328f6 100644
--- a/tests/pickling/partialApplications.scala
+++ b/tests/pickling/partialApplications.scala
@@ -1,13 +1,29 @@
-object PartialApplications {
+object partialApplications {
- type Histogram = Map[_, Int]
+ type Histogram[X] = Map[X, Int]
- type StringlyHistogram = Histogram[_ >: String]
+ type StringlyHistogram[X >: String] = Histogram[X]
val xs: Histogram[String] = Map[String, Int]()
val ys: StringlyHistogram[String] = xs
- val zs: StringlyHistogram = xs
+ def e = xs
+
+ val zs: StringlyHistogram[_] = e
+
+ type IntMap[Y] = Map[Int, Y]
+
+ val is = Map[Int, Boolean]()
+
+ val js: IntMap[Boolean] = is
+
+ val ks: IntMap[_] = is
+
+ type RMap[X, Y] = Map[Y, X]
+
+ val rs = Map[Int, Float]()
+
+ val ss: RMap[Float, Int] = rs
}