File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
core/src/main/scala/magnolia1 Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,13 @@ object CaseClassDerivation:
6262 typeAnnotations
6363 ):
6464 def construct [PType : ClassTag ](makeParam : Param => PType ): A =
65- product.fromProduct(Tuple .fromArray (parameters.map(makeParam).to( Array )))
65+ product.fromProduct(Tuple .fromIArray (parameters.map(makeParam)))
6666
67- def rawConstruct (fieldValues : Seq [Any ]): A =
68- product.fromProduct(Tuple .fromArray(fieldValues.to(Array )))
67+ override def rawConstruct (fieldValues : Seq [Any ]): A =
68+ rawConstruct(fieldValues.toArray)
69+
70+ override def rawConstruct (fieldValues : Array [Any ]): A =
71+ product.fromProduct(Tuple .fromArray(fieldValues))
6972
7073 def constructEither [Err , PType : ClassTag ](
7174 makeParam : Param => Either [Err , PType ]
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package magnolia1
33import magnolia1 .CaseClass .getDefaultEvaluatorFromDefaultVal
44
55import scala .annotation .tailrec
6+ import scala .collection .immutable .ArraySeq
67import scala .reflect .*
78
89case class TypeInfo (
@@ -156,6 +157,7 @@ abstract class CaseClass[Typeclass[_], Type](
156157 makeParam : Param => Either [Err , PType ]
157158 ): Either [List [Err ], Type ]
158159 def rawConstruct (fieldValues : Seq [Any ]): Type
160+ def rawConstruct (fieldValues : Array [Any ]): Type = rawConstruct(ArraySeq .unsafeWrapArray(fieldValues))
159161
160162 def param [P ](
161163 name : String ,
You can’t perform that action at this time.
0 commit comments