aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run/t8280.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/run/t8280.scala b/tests/run/t8280.scala
index 0734d63b6..1c9d5cbaa 100644
--- a/tests/run/t8280.scala
+++ b/tests/run/t8280.scala
@@ -20,7 +20,11 @@ object Moop1 {
implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" }
implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" }
- println(5: String)
+ // println(5: String)
+ // Dotty deviation. The above fails for Dotty with ambiguity error.
+ // Both f1 and f2 are applicable conversions for Int => String. Neither is better than the other.
+ // Scala2 contains a hack for backwards compatibility, which we are not forced to repeat.
+ // See discussion under SI-8280.
}
object ob2 {
implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" }
@@ -64,7 +68,7 @@ object Moop3 {
implicit val f1: Int => String = _ => "Int"
implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" }
- println(5: String)
+ // println(5: String) // Dotty deviation. This fails for Dotty with ambiguity error.
}
object ob2 {
implicit val f1: Int => String = _ => "Int"