From c560260df88d597fb8858603deb233c8212163b9 Mon Sep 17 00:00:00 2001 From: Rahul Goma Phulore Date: Sun, 26 Nov 2017 21:02:58 +0000 Subject: Avoid instantiating Unit when producing error stack Fixes https://github.com/propensive/magnolia/issues/41. --- tests/src/main/scala/tests.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/src/main/scala/tests.scala b/tests/src/main/scala/tests.scala index e453502..cf31836 100644 --- a/tests/src/main/scala/tests.scala +++ b/tests/src/main/scala/tests.scala @@ -161,6 +161,16 @@ object Tests extends TestApp { | in parameter 'alpha' of product type Beta |""")) + test("not attempt to instantiate Unit when producing error stack") { + scalac""" + import magnolia.examples._ + case class Gamma(unit: Unit) + Show.gen[Gamma] + """ + }.assert(_ == TypecheckError(txt"""magnolia: could not find typeclass for type Unit + | in parameter 'unit' of product type Gamma + |""")) + test("typenames and labels are not encoded") { implicitly[Show[String, `%%`]].show(`%%`(1, "two")) }.assert(_ == "%%(/=1,#=two)") -- cgit v1.2.3