File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
core/src/main/scala/magnolia1 Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -117,11 +117,10 @@ object CaseClassDerivation:
117117 new SerializableFunction0 [Option [p]]:
118118 override def apply (): Option [p] =
119119 val v = evaluator()
120- if ((v : @ unchecked).isInstanceOf [p]) Some (v.asInstanceOf [p])
120+ if ((v : @ unchecked).isInstanceOf [p]) new Some (v) .asInstanceOf [Option [p]]
121121 else None
122122 case _ =>
123- new SerializableFunction0 [Option [p]]:
124- override def apply (): Option [p] = None
123+ returningNone.asInstanceOf [SerializableFunction0 [Option [p]]]
125124 }
126125 paramFromMaps[Typeclass , A , p](
127126 label,
@@ -163,6 +162,10 @@ object CaseClassDerivation:
163162 IArray .from(typeAnnotations.getOrElse(label, List ()))
164163 )
165164
165+ private val returningNone =
166+ new SerializableFunction0 [Option [Any ]]:
167+ override def apply (): Option [Any ] = None
168+
166169end CaseClassDerivation
167170
168171trait SealedTraitDerivation :
You can’t perform that action at this time.
0 commit comments