aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJon Pretty <jon.pretty@propensive.com>2017-11-30 18:32:07 +0000
committerJon Pretty <jon.pretty@propensive.com>2017-11-30 18:32:07 +0000
commit13fcfba5aa5d6a90b90c22088cb9b8da5e2823fe (patch)
tree108d5b0fbdb814c8b85d7e9814f811adb94d7aeb /core
parente2191e2687b671d4a8610544251e7e807f2793da (diff)
downloadmagnolia-13fcfba5aa5d6a90b90c22088cb9b8da5e2823fe.tar.gz
magnolia-13fcfba5aa5d6a90b90c22088cb9b8da5e2823fe.tar.bz2
magnolia-13fcfba5aa5d6a90b90c22088cb9b8da5e2823fe.zip
typeName is now the full name of the type, in original case
Diffstat (limited to 'core')
-rw-r--r--core/shared/src/main/scala/magnolia.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/shared/src/main/scala/magnolia.scala b/core/shared/src/main/scala/magnolia.scala
index c4c13e6..6528db0 100644
--- a/core/shared/src/main/scala/magnolia.scala
+++ b/core/shared/src/main/scala/magnolia.scala
@@ -223,10 +223,11 @@ object Magnolia {
val isValueClass = genericType <:< typeOf[AnyVal] && !primitives.exists(_ =:= genericType)
val resultType = appliedType(typeConstructor, genericType)
+
+ val className = s"${genericType.typeSymbol.owner.fullName}.${genericType.typeSymbol.name.decodedName}"
val result = if (isCaseObject) {
val obj = companionRef(genericType)
- val className = genericType.typeSymbol.name.decodedName.toString
val impl = q"""
${c.prefix}.combine($magnoliaPkg.Magnolia.caseClass[$typeConstructor, $genericType](
@@ -239,7 +240,6 @@ object Magnolia {
case m: MethodSymbol if m.isCaseAccessor || (isValueClass && m.isParamAccessor) =>
m.asMethod
}
- val className = genericType.typeSymbol.name.decodedName.toString
case class CaseParam(sym: c.universe.MethodSymbol,
repeated: Boolean,
@@ -372,13 +372,13 @@ object Magnolia {
val assignments = typeclasses.zipWithIndex.map {
case ((typ, typeclass), idx) =>
q"""$subtypesVal($idx) = $magnoliaPkg.Magnolia.subtype[$typeConstructor, $genericType, $typ](
- ${typ.typeSymbol.fullName.toString},
+ ${s"${typ.typeSymbol.owner.fullName}.${typ.typeSymbol.name.decodedName}"},
$typeclass,
(t: $genericType) => t.isInstanceOf[$typ],
(t: $genericType) => t.asInstanceOf[$typ]
)"""
}
-
+
Some {
Typeclass(
genericType,
@@ -389,7 +389,7 @@ object Magnolia {
..$assignments
${c.prefix}.dispatch(new $magnoliaPkg.SealedTrait(
- $genericTypeName,
+ $className,
$subtypesVal: $scalaPkg.Array[$magnoliaPkg.Subtype[$typeConstructor, $genericType]])
): $resultType
}"""