diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-01-11 01:21:46 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-01-28 19:12:18 +0100 |
commit | 8d603d815d6c7caee05cf34402273fd4108c4efb (patch) | |
tree | eb476d5669123835422cb537cfce97511f683f3f /library | |
parent | d71be28057621750f1ccb168f538c6d942935cac (diff) | |
download | dotty-8d603d815d6c7caee05cf34402273fd4108c4efb.tar.gz dotty-8d603d815d6c7caee05cf34402273fd4108c4efb.tar.bz2 dotty-8d603d815d6c7caee05cf34402273fd4108c4efb.zip |
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.
Diffstat (limited to 'library')
-rw-r--r-- | library/test/dotty/ShowTests.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/test/dotty/ShowTests.scala b/library/test/dotty/ShowTests.scala index 7230106d5..b050ad3ee 100644 --- a/library/test/dotty/ShowTests.scala +++ b/library/test/dotty/ShowTests.scala @@ -35,13 +35,13 @@ class ShowTests { @Test def showCar = { case class Car(model: String, manufacturer: String, year: Int) - implicit val showCar = new Show[Car] { + implicit val showCar: Show[Car] = new Show[Car] { def show(c: Car) = "Car(" + c.model.show + ", " + c.manufacturer.show + ", " + c.year.show + ")" } case class Shop(xs: List[Car], name: String) - implicit val showShop = new Show[Shop] { + implicit val showShop: Show[Shop] = new Show[Shop] { def show(sh: Shop) = "Shop(" + sh.xs.show + ", " + sh.name.show + ")" } |