diff options
author | Martin Odersky <odersky@gmail.com> | 2015-07-21 18:42:17 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-09-18 18:12:17 +0200 |
commit | e8aecfa4d48383321549aa8f1ec8d1edb0ccaf06 (patch) | |
tree | 07b68f223127eff223adbbe4602c05b4a04339c6 /tests/pos | |
parent | 4148970a984de945c69f345381f0f03e84d7d6c2 (diff) | |
download | dotty-e8aecfa4d48383321549aa8f1ec8d1edb0ccaf06.tar.gz dotty-e8aecfa4d48383321549aa8f1ec8d1edb0ccaf06.tar.bz2 dotty-e8aecfa4d48383321549aa8f1ec8d1edb0ccaf06.zip |
Disallow wildcard arguments to higher-kinded types...
...unless the HK type can be eta-reduced to a class type.
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/partialApplications.scala | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/pos/partialApplications.scala b/tests/pos/partialApplications.scala index c1df1dee2..285dc8661 100644 --- a/tests/pos/partialApplications.scala +++ b/tests/pos/partialApplications.scala @@ -8,6 +8,39 @@ object Test { 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 + +} + +object Test2 { + type Histogram = Map[_, Int] + + type StringlyHistogram = Histogram[_ >: String] // error + + val xs: Histogram[String] = Map[String, Int]() // error + + val ys: StringlyHistogram[String] = xs // error + + val zs: StringlyHistogram = xs // error + + val xs1 = xs + val ys1 = ys + val zs1 = zs } |