From 615af3df03f9079691f6aec5992671ae2c08dac9 Mon Sep 17 00:00:00 2001 From: Leandro Bolivar Date: Sat, 25 Nov 2017 11:44:01 -0500 Subject: Minor semantic error --- core/shared/src/main/scala/magnolia.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/shared/src/main/scala/magnolia.scala b/core/shared/src/main/scala/magnolia.scala index 4f1c665..375ae6e 100644 --- a/core/shared/src/main/scala/magnolia.scala +++ b/core/shared/src/main/scala/magnolia.scala @@ -282,13 +282,13 @@ object Magnolia { // If a companion object is defined with alternative apply methods // it is needed get all the alternatives - val constructorMethod = + val constructorMethods = caseClassCompanion.decl(TermName("apply")).alternatives.map(_.asMethod) // The last apply method in the alternatives is the one that belongs // to the case class, not the user defined companion object val indexedConstructorParams = - constructorMethod.last.paramLists.head.map(_.asTerm).zipWithIndex + constructorMethods.last.paramLists.head.map(_.asTerm).zipWithIndex indexedConstructorParams.map { case (p, idx) => -- cgit v1.2.3