From 091788d0ad6f94c91cc20d6074c3403934702325 Mon Sep 17 00:00:00 2001 From: Jon Pretty Date: Wed, 6 Jun 2018 21:27:28 +0100 Subject: Permit derivations of products when `dispatch` not defined --- core/shared/src/main/scala/magnolia.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/shared/src/main/scala') diff --git a/core/shared/src/main/scala/magnolia.scala b/core/shared/src/main/scala/magnolia.scala index 6001977..dd1e0e8 100644 --- a/core/shared/src/main/scala/magnolia.scala +++ b/core/shared/src/main/scala/magnolia.scala @@ -127,9 +127,7 @@ object Magnolia { error(s"magnolia: the method `combine` should take a single parameter of type $expected") } - // FIXME: Only run these methods if they're used, particularly `dispatch` checkMethod("combine", "case classes", "CaseClass[Typeclass, _]") - checkMethod("dispatch", "sealed traits", "SealedTrait[Typeclass, _]") val expandDeferred = new Transformer { override def transform(tree: Tree) = tree match { @@ -333,6 +331,7 @@ object Magnolia { }})})) }""") } else if (isSealedTrait) { + checkMethod("dispatch", "sealed traits", "SealedTrait[Typeclass, _]") val genericSubtypes = knownSubclasses(classType.get) val subtypes = genericSubtypes.map { sub => val subType = sub.asType.toType // FIXME: Broken for path dependent types -- cgit v1.2.3