diff --git a/upickle/implicits/src-2/upickle/implicits/internal/Macros.scala b/upickle/implicits/src-2/upickle/implicits/internal/Macros.scala index 115fc5bc0..4db982416 100644 --- a/upickle/implicits/src-2/upickle/implicits/internal/Macros.scala +++ b/upickle/implicits/src-2/upickle/implicits/internal/Macros.scala @@ -219,9 +219,9 @@ object Macros { fail(tpe, _), ) - val myself: Option[Symbol] = sealedParents.find(_ == tpe.typeSymbol) + val sealedClassSymbol: Option[Symbol] = sealedParents.find(_ == tpe.typeSymbol) val segments = - myself.toList.map(_.fullName.split('.')) ++ + sealedClassSymbol.toList.map(_.fullName.split('.')) ++ sealedParents .flatMap(_.asClass.knownDirectSubclasses) .map(_.fullName.split('.')) diff --git a/upickle/implicits/src-3/upickle/implicits/macros.scala b/upickle/implicits/src-3/upickle/implicits/macros.scala index 1fd77c683..50d50ee9d 100644 --- a/upickle/implicits/src-3/upickle/implicits/macros.scala +++ b/upickle/implicits/src-3/upickle/implicits/macros.scala @@ -309,7 +309,7 @@ def tagNameImpl0[T](transform: String => String)(using Quotes, Type[T]): Expr[St inline def shortTagName[T]: String = ${ shortTagNameImpl[T] } def shortTagNameImpl[T](using Quotes, Type[T]): Expr[String] = import quotes.reflect._ - val myself = if (TypeRepr.of[T].baseClasses.contains(TypeRepr.of[T].typeSymbol)) + val sealedClassSymbol = if (TypeRepr.of[T].baseClasses.contains(TypeRepr.of[T].typeSymbol)) Some(TypeRepr.of[T].typeSymbol.fullName.split('.')) else None val segments = TypeRepr.of[T].baseClasses @@ -317,7 +317,7 @@ def shortTagNameImpl[T](using Quotes, Type[T]): Expr[String] = .flatMap(_.children) .filter(_.flags.is(Flags.Case)) .map(_.fullName.split('.')) ++ - myself.toList + sealedClassSymbol.toList val identicalSegmentCount = Range(0, segments.map(_.length).max - 1) .takeWhile(i => segments.map(_.lift(i)).distinct.size == 1)