Skip to content

Commit

Permalink
Fix SizedCodec.size for case objects
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaciv committed Sep 23, 2024
1 parent 53780f9 commit e614e2d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class GenCodecMacros(ctx: blackbox.Context) extends CodecMacroCommons(ctx) with
q"""
new $SerializationPkg.SingletonCodec[$tpe](${tpe.toString}, $safeSingleValue) {
..${generated.map({ case (sym, depTpe) => generatedDepDeclaration(sym, depTpe) })}
override def size(value: $tpe): $IntCls = ${generated.size}
override def size(value: $tpe, output: $OptCls[$SerializationPkg.SequentialOutput]): $IntCls = ${generated.size}
override def writeFields(output: $SerializationPkg.ObjectOutput, value: $tpe): $UnitCls = {
..${generated.map({ case (sym, _) => generatedWrite(sym) })}
}
Expand Down

0 comments on commit e614e2d

Please sign in to comment.