aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-04-22 17:43:22 +0200
committerGuillaume Martres <smarter@ubuntu.com>2016-04-22 17:43:22 +0200
commitd5dfd16083728d6d4afdf58a224a4bd2829969b1 (patch)
tree1a62f12ee3227f2ea75381068755f73d8b1205dd /tests
parent05bfe78c6f881884272e31cfd1eea993a1ad9f8a (diff)
downloaddotty-d5dfd16083728d6d4afdf58a224a4bd2829969b1.tar.gz
dotty-d5dfd16083728d6d4afdf58a224a4bd2829969b1.tar.bz2
dotty-d5dfd16083728d6d4afdf58a224a4bd2829969b1.zip
Add test that demonstrate that #878 is fixed
It was fixed by 2460f9603b0f0ed1d73dfea99edcee9ba6261d36
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/i878.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/pos/i878.scala b/tests/pos/i878.scala
new file mode 100644
index 000000000..771ab58ce
--- /dev/null
+++ b/tests/pos/i878.scala
@@ -0,0 +1,17 @@
+class X
+
+class Message[-A]
+class Seg[+A]
+class IChan[A] {
+ def add[B >: A](x: Seg[B])(implicit ev: Message[B]): IChan[B] = ???
+}
+
+class Test {
+ def test: Unit = {
+ implicit val mx: Message[X] = ???
+ val fx: IChan[X] = ???
+ val sx: Seg[X] = ???
+ // the implicit `mx` should be used even though the type parameter of Message is contravariant
+ fx.add(sx)
+ }
+}