Closed wsargent closed 5 years ago
In the sjson generation code, the pattern match uses the identifier of js, which can conflict with the type field if it is also named js:
js
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError } trait DeviceInfoFormats { self: sjsonnew.BasicJsonProtocol => implicit lazy val DeviceInfoFormat: JsonFormat[DeviceInfo] = new JsonFormat[DeviceInfo] { override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): DeviceInfo = { jsOpt match { case Some(js) => unbuilder.beginObject(js) val js = unbuilder.readField[Option[Boolean]]("js") case None => deserializationError("Expected JsObject but found None") } }
results in
[error] <snip>/codecs/DeviceInfoFormats.scala:13:29: type mismatch; [error] found : js.type (with underlying type Option[Boolean]) [error] required: J [error] unbuilder.beginObject(js) [error] ^
Looks like it's at https://github.com/sbt/contraband/blob/master/library/src/main/scala/sbt/contraband/CodecCodeGen.scala#L66
In the sjson generation code, the pattern match uses the identifier of
js
, which can conflict with the type field if it is also namedjs
:results in
Looks like it's at https://github.com/sbt/contraband/blob/master/library/src/main/scala/sbt/contraband/CodecCodeGen.scala#L66