amnaredo / test

0 stars 0 forks source link

upickle.default.write when field value is 0 then field is lose #262

Open amnaredo opened 3 years ago

amnaredo commented 3 years ago

Hi, Please open link https://scalafiddle.io/sf/UbAmA6A/0 You can see my code: ` import upickle.default.{macroRW, ReadWriter => RW, Reader => R, Writer => W}

case class ResultVo[E](result: E, totalCount: Long = 0, status: Int, msg: String, now: String)

object ResultVo{

implicit def rw[E: R: W]: RW[ResultVo[E]] = macroRW

}

println(upickle.default.write(ResultVo("ok", 0L, 200, "success", "2019-01-10 00:00:59"))) I use "com.lihaoyi" %%% "upickle" % "0.9.5", Then Run result is {"result":"ok","status":200,"msg":"success","now":"2019-01-10 00:00:59"}` Why the totalCount is lose ??? Thank you!

ID: 294 Original Author: kizzyang