From 89540268e6c49fb92b9ca61249e46bb59981bf5a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 4 May 2016 12:09:52 +0200 Subject: 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. --- tests/pos-scala2/t2030.scala | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/pos-scala2/t2030.scala (limited to 'tests/pos-scala2') 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) +} -- cgit v1.2.3