Skip to content

Codec.Record[T] breaks when case class contains a field named 'value' #246

@fauna-arnaud

Description

@fauna-arnaud

Using fauna-scala 3.0.0

case class Type(value: String, count: Int)

object Type {
  implicit val codec: RecordCodec[Type] = Codec.Record[Type]
}

yields

[error] /home/agourlay/Workspace/allez-fauna/server/src/main/scala/agourlay/allez/api/Models.scala:54:55: type mismatch;
[error]  found   : String("count")
[error]  required: Int
[error]   implicit val codec: RecordCodec[Type] = Codec.Record[Type]
[error]                                                       ^
[error] one error found

whereas the following compiles

case class Type(v: String, count: Int)

object Type {
  implicit val codec: RecordCodec[Type] = Codec.Record[Type]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions