Skip to content

Commit ae594f8

Browse files
authored
Code clean up
1 parent a4170ae commit ae594f8

File tree

1 file changed

+1
-2
lines changed
  • jsoniter-scala-macros/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/macros

1 file changed

+1
-2
lines changed

jsoniter-scala-macros/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMaker.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,8 +1992,7 @@ object JsonCodecMaker {
19921992
else if (isValueClass(tpe)) {
19931993
genWriteVal(q"$m.${valueClassValueMethod(tpe)}", valueClassValueType(tpe) :: types, isStringified, EmptyTree)
19941994
} else if (isOption(tpe, types.tail)) {
1995-
val tpe1 = typeArg1(tpe)
1996-
q"""if ($m ne _root_.scala.None) ${genWriteVal(q"$m.asInstanceOf[Some[$tpe1]].value", tpe1 :: types, isStringified, EmptyTree)}
1995+
q"""if ($m ne _root_.scala.None) ${genWriteVal(q"$m.get", typeArg1(tpe) :: types, isStringified, EmptyTree)}
19971996
else out.writeNull()"""
19981997
} else if (tpe <:< typeOf[Array[_]] || isImmutableArraySeq(tpe) ||
19991998
isMutableArraySeq(tpe)) withEncoderFor(methodKey, m) {

0 commit comments

Comments
 (0)