Skip to content

Commit 3460856

Browse files
committed
Update check file
and explain why it's different now.
1 parent f48ea79 commit 3460856

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/run/t8280.check

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
Int
22
Int
3-
Int
4-
Int
5-
Int
3+
Long
64
Int
75
Int
86
Int

tests/run/t8280.scala

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ object Moop1 {
2525
// Both f1 and f2 are applicable conversions for Int => String. Neither is better than the other.
2626
// Scala2 contains a hack for backwards compatibility, which we are not forced to repeat.
2727
// See discussion under SI-8280.
28+
2829
}
2930
object ob2 {
3031
implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" }
@@ -46,7 +47,7 @@ object Moop2 {
4647
implicit def f1(x: Int): String = "Int"
4748
implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" }
4849

49-
println(5: String)
50+
println(5: String) // Dotty deviation: Dotty picks f2, because non-methods are more specific than methods
5051
}
5152
object ob2 {
5253
implicit def f1(x: Int): String = "Int"
@@ -68,7 +69,8 @@ object Moop3 {
6869
implicit val f1: Int => String = _ => "Int"
6970
implicit object f2 extends (Long => String) { def apply(x: Long): String = "Long" }
7071

71-
// println(5: String) // Dotty deviation. This fails for Dotty with ambiguity error.
72+
// println(5: String)
73+
// Dotty deviation. This fails for Dotty with ambiguity error for similar reasons as ob1.
7274
}
7375
object ob2 {
7476
implicit val f1: Int => String = _ => "Int"

0 commit comments

Comments
 (0)