aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2015-06-25 22:52:01 +0200
committerodersky <odersky@gmail.com>2015-06-25 22:52:01 +0200
commit67aef97ccac65be6390fed93e5c22cc0c0fa974d (patch)
tree16424996b91f8b628d08abd657ef77362a3c2d15 /tests/pos
parent0fba8757b444d96c748df1e034d39f7626a39d1e (diff)
parentd973e5d15e51aa8a74f4b1141eef6c4064509dd3 (diff)
downloaddotty-67aef97ccac65be6390fed93e5c22cc0c0fa974d.tar.gz
dotty-67aef97ccac65be6390fed93e5c22cc0c0fa974d.tar.bz2
dotty-67aef97ccac65be6390fed93e5c22cc0c0fa974d.zip
Merge pull request #678 from dotty-staging/fix/#670-orphan-polyparam
Avoid junk produced by Constraint#replace.
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/t8230a.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/pos/t8230a.scala b/tests/pos/t8230a.scala
new file mode 100644
index 000000000..dfbae51ee
--- /dev/null
+++ b/tests/pos/t8230a.scala
@@ -0,0 +1,26 @@
+trait Arr[T]
+object Arr {
+ def apply[T](xs: T): Arr[T] = null
+ def apply(x: Long) : Arr[Long] = null
+}
+
+object I {
+ implicit def arrToTrav[T] (a: Arr[T]) : Traversable[T] = null
+ implicit def longArrToTrav(a: Arr[Long]): Traversable[Long] = null
+}
+
+object Test {
+ def foo(t: Traversable[Any]) = {}
+
+ object Okay {
+ Arr("1")
+
+ import I.{ arrToTrav, longArrToTrav }
+ val x = foo(Arr("2"))
+ }
+
+ object Fail {
+ import I.arrToTrav
+ foo(Arr("3")) // found String, expected Long
+ }
+}