Skip to content

Commit 8d603d8

Browse files
committed
dotty.ShowTests: fix cyclic references involving implicit values
As reportd by dotty (same thing with showShop): cyclic reference involving implicit value showCar This happens when the right hand-side of value showCar's definition involves an implicit search. To avoid the error, give value showCar an explicit type.
1 parent d71be28 commit 8d603d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/test/dotty/ShowTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class ShowTests {
3535

3636
@Test def showCar = {
3737
case class Car(model: String, manufacturer: String, year: Int)
38-
implicit val showCar = new Show[Car] {
38+
implicit val showCar: Show[Car] = new Show[Car] {
3939
def show(c: Car) =
4040
"Car(" + c.model.show + ", " + c.manufacturer.show + ", " + c.year.show + ")"
4141
}
4242

4343
case class Shop(xs: List[Car], name: String)
44-
implicit val showShop = new Show[Shop] {
44+
implicit val showShop: Show[Shop] = new Show[Shop] {
4545
def show(sh: Shop) =
4646
"Shop(" + sh.xs.show + ", " + sh.name.show + ")"
4747
}

0 commit comments

Comments
 (0)