aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/hklower.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-07-14 18:06:48 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-14 19:52:22 +0200
commit82fc27f0c2c800de786b54110cfd8627b043fe6d (patch)
tree92bff1bc2f6869495e46fd77a1220153c25b46ac /tests/pos/hklower.scala
parent18b30803952cee83580eab28068bc773fdce780e (diff)
downloaddotty-82fc27f0c2c800de786b54110cfd8627b043fe6d.tar.gz
dotty-82fc27f0c2c800de786b54110cfd8627b043fe6d.tar.bz2
dotty-82fc27f0c2c800de786b54110cfd8627b043fe6d.zip
Fix bounds checking of hk applied typed
Previous logic could only handle classes as constructors. Also, address other reviewers comments.
Diffstat (limited to 'tests/pos/hklower.scala')
-rw-r--r--tests/pos/hklower.scala34
1 files changed, 32 insertions, 2 deletions
diff --git a/tests/pos/hklower.scala b/tests/pos/hklower.scala
index 033ee3a34..90aa343ba 100644
--- a/tests/pos/hklower.scala
+++ b/tests/pos/hklower.scala
@@ -1,4 +1,4 @@
-class Test { // error: conflicting bounds
+class Test {
type T[X]
type U[X] = T[X]
@@ -6,6 +6,36 @@ class Test { // error: conflicting bounds
type V[X] >: T[X]
type W[X] >: T[X] <: T[X]
- def f[C[X] >: T[X]]() = ???
+ def f[C[X] >: T[X]](x: C[Int]) = ???
+
+ val v: V[Int] = ???
+ val t: T[Int] = ???
+
+ f[V](v)
+
+ f[V](t)
+
+
+}
+class Test2 {
+
+ class T[X]
+ type U[X] = T[X]
+
+ type V[X] >: T[X]
+ type W[X] >: T[X] <: T[X]
+
+ def f[C[X] >: T[X]](x: C[Int]) = ???
+
+ val v: V[Int] = ???
+ val t: T[Int] = ???
+
+ f[V](v)
+
+ f[V](t)
+
+ var x: V[Int] = _
+ x = t
+
}