Skip to content

Commit f2e1ef8

Browse files
committed
Clean up isValueClass check for Scala 2 macros
1 parent 180fbb7 commit f2e1ef8

File tree

1 file changed

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

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,8 @@ object JsonCodecMaker {
952952
})
953953
})
954954

955-
def isValueClass(tpe: Type): Boolean = !isConstType(tpe) &&
956-
(cfg.inlineOneValueClasses && isNonAbstractScalaClass(tpe) && !isCollection(tpe) && getClassInfo(tpe).fields.size == 1 ||
957-
tpe.typeSymbol.isClass && tpe.typeSymbol.asClass.isDerivedValueClass)
955+
def isValueClass(tpe: Type): Boolean = !isConstType(tpe) && isNonAbstractScalaClass(tpe) &&
956+
(tpe.typeSymbol.asClass.isDerivedValueClass || cfg.inlineOneValueClasses && !isCollection(tpe) && getClassInfo(tpe).fields.size == 1)
958957

959958
def adtLeafClasses(adtBaseTpe: Type): Seq[Type] = {
960959
def collectRecursively(tpe: Type): Seq[Type] = {

0 commit comments

Comments
 (0)