aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Bolivar <leandrob131@gmail.com>2017-11-25 11:32:13 -0500
committerLeandro Bolivar <leandrob131@gmail.com>2017-11-25 11:32:13 -0500
commit3882602c0f233a6849c4ea5b179fe3c7ef7aadf4 (patch)
tree09e0ba58df878729604c474b5b62afde8ff9af9c
parent2de22e7d27025f839ef70916d3bfb99e69973521 (diff)
downloadmagnolia-3882602c0f233a6849c4ea5b179fe3c7ef7aadf4.tar.gz
magnolia-3882602c0f233a6849c4ea5b179fe3c7ef7aadf4.tar.bz2
magnolia-3882602c0f233a6849c4ea5b179fe3c7ef7aadf4.zip
Minor format fix
-rw-r--r--core/shared/src/main/scala/magnolia.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/shared/src/main/scala/magnolia.scala b/core/shared/src/main/scala/magnolia.scala
index 337edc7..4f1c665 100644
--- a/core/shared/src/main/scala/magnolia.scala
+++ b/core/shared/src/main/scala/magnolia.scala
@@ -279,15 +279,16 @@ object Magnolia {
val defaults = if (!isValueClass) {
val caseClassCompanion = genericType.companion
+
// If a companion object is defined with alternative apply methods
// it is needed get all the alternatives
val constructorMethod =
- caseClassCompanion.decl(TermName("apply")).alternatives.map(_.asMethod)
+ 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
+ constructorMethod.last.paramLists.head.map(_.asTerm).zipWithIndex
indexedConstructorParams.map {
case (p, idx) =>