aboutsummaryrefslogtreecommitdiff
path: root/tests/pos-scala2
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-05-04 12:09:52 +0200
committerMartin Odersky <odersky@gmail.com>2016-05-23 16:11:45 +0200
commit89540268e6c49fb92b9ca61249e46bb59981bf5a (patch)
tree5d7296175b7f27fd4243c61775bf262b84ea919f /tests/pos-scala2
parent039e20f3919d2ff4aa30a1f58314d0d0bff319c0 (diff)
downloaddotty-89540268e6c49fb92b9ca61249e46bb59981bf5a.tar.gz
dotty-89540268e6c49fb92b9ca61249e46bb59981bf5a.tar.bz2
dotty-89540268e6c49fb92b9ca61249e46bb59981bf5a.zip
Downwards comparisons for implicit search and overloading resolution
Compare selected contravariant arguments as if they were covariant. Which ones is explained in the doc comment for method `isAsSpecificValueType` in Applications.scala. This has the same motivation than what @paulp proposed around 2012. The solution is a bit different from the one proposed then because it only affects top-level parameters.
Diffstat (limited to 'tests/pos-scala2')
-rw-r--r--tests/pos-scala2/t2030.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/pos-scala2/t2030.scala b/tests/pos-scala2/t2030.scala
new file mode 100644
index 000000000..cbd62baba
--- /dev/null
+++ b/tests/pos-scala2/t2030.scala
@@ -0,0 +1,8 @@
+import scala.collection.immutable._
+
+object Test extends dotty.runtime.LegacyApp {
+ val res0 = TreeSet(1, 2, 3, 4, 5, 6)
+ val res1 = res0.map(x => x)
+ println(res0.toList == res1.toList)
+ println(res1.getClass)
+}