File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,6 +277,7 @@ object RWMacros {
277277 val name = field.asTerm.name
278278 val innerType = tpe.decl(name).typeSignature.asSeenFrom(tpe, tpe.typeSymbol.asClass)
279279 val companion = tpe.typeSymbol.companion
280+ val className = tpe.typeSymbol.fullName
280281 return context.Expr [RW [T ]](q """
281282 import _root_.fabric._
282283 import _root_.fabric.rw._
@@ -286,7 +287,7 @@ object RWMacros {
286287 private val innerRW = implicitly[RW[ $innerType]]
287288 override def read(t: $tpe): Json = innerRW.read(t. $name)
288289 override def write(value: Json): $tpe = $companion(innerRW.write(value))
289- override def definition: DefType = innerRW.definition
290+ override val definition: DefType = innerRW.definition.withClassName( $className )
290291 }
291292 """ )
292293 case _ => // fall through to normal path
Original file line number Diff line number Diff line change @@ -645,6 +645,7 @@ object CompileRW extends CompileRW {
645645 val innerRW = Expr .summon[RW [inner]].getOrElse {
646646 report.errorAndAbort(s " No RW found for AnyVal inner type ${fieldType.show}" )
647647 }
648+ val classNameExpr = Expr (typeSymbol.fullName)
648649 ' {
649650 new RW [T ] {
650651 override def read (value : T ): Json = {
@@ -655,7 +656,7 @@ object CompileRW extends CompileRW {
655656 val inner = $innerRW.write(json)
656657 $ { Apply (Select (New (TypeTree .of[T ]), typeSymbol.primaryConstructor), List (' { inner }.asTerm)).asExprOf[T ] }
657658 }
658- override def definition : DefType = $innerRW.definition
659+ override val definition : DefType = $innerRW.definition.withClassName($classNameExpr)
659660 }
660661 }
661662 }
Original file line number Diff line number Diff line change @@ -289,7 +289,6 @@ object DefType {
289289 override def description : Option [String ] = dt.description
290290 override def isOpt : Boolean = dt.isOpt
291291 override def isNull : Boolean = dt.isNull
292- override def opt : DefType = Classed (dt.opt, cn)
293292 override def withClassName (cn : String ): DefType = copy(cn = cn)
294293 override def describe (desc : String ): DefType = Classed (dt.describe(desc), cn)
295294 override def merge (that : DefType ): DefType = Classed (dt.merge(that), cn)
You can’t perform that action at this time.
0 commit comments