Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected compilation error with "one value" and AnyVal classes #1107

Closed
plokhotnyuk opened this issue Jan 21, 2024 · 0 comments
Closed

Unexpected compilation error with "one value" and AnyVal classes #1107

plokhotnyuk opened this issue Jan 21, 2024 · 0 comments
Labels

Comments

@plokhotnyuk
Copy link
Owner

Reporting on behalf of @kyri-petrou from his messages in the Gitter chat.

The following snippets of code fails to compile.

case class Obj(l: Map[String, String])

object Obj {
  implicit val codec: JsonValueCodec[Obj] = JsonCodecMaker.make(
    CodecMakerConfig.withInlineOneValueClasses(true)
  )
}
case class Obj(l: Map[String, String]) extends AnyVal

implicit val codec: JsonValueCodec[Obj] = JsonCodecMaker.make

The compilation error is the same:

[error]      |Exception occurred while executing macro expansion.
[error]      |java.lang.Exception: Expr cast exception: x
[error]      |of type: x
[error]      |did not conform to type: scala.collection.Map[java.lang.String, java.lang.String]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant