amnaredo / test

0 stars 0 forks source link

default case class values are ignored #263

Open amnaredo opened 2 years ago

amnaredo commented 2 years ago

I have tried the following on ammonite 2.0.3

@ case class Person(name:String="default", age:Int=0) defined class Person

@ implicit val personRW = upickle.default.macroRW[Person]

@ upickle.default.write(Person("me",42)) res55: String = "{\"name\":\"me\",\"age\":42}"

@ upickle.default.write(Person()) res56: String = "{}"

I expected String = "{\"name\":\"default\",\"age\":0}"

@ upickle.default.write(Person("default", 0 )) res57: String = "{}"

I expected String = "{\"name\":\"default\",\"age\":0}"

Am I wrong ? ID: 296 Original Author: opoppon

amnaredo commented 2 years ago

This was made configurable via https://github.com/lihaoyi/upickle/pull/295 Original Author: lihaoyi