aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/neg/partialApplications.scala11
-rw-r--r--tests/pos/partialApplications.scala35
2 files changed, 45 insertions, 1 deletions
diff --git a/tests/neg/partialApplications.scala b/tests/neg/partialApplications.scala
new file mode 100644
index 000000000..67f6cf059
--- /dev/null
+++ b/tests/neg/partialApplications.scala
@@ -0,0 +1,11 @@
+object Test {
+
+ type RMap[X, Y] = Map[Y, X]
+ val m = Map[Int, String]()
+ val ts: RMap[_, Int] = m // erorr // error
+ val us: RMap[String, _] = m // error // error
+ val vs: RMap[_, _] = m // error // error // error
+ val zz: RMap = m // error
+
+}
+
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
}