Skip to content
New issue

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

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

Already on GitHub? # to your account

Cannot construct Option instance #121

Closed
kpodsiad opened this issue Dec 30, 2021 · 0 comments · Fixed by #128
Closed

Cannot construct Option instance #121

kpodsiad opened this issue Dec 30, 2021 · 0 comments · Fixed by #128
Labels
bug Something isn't working

Comments

@kpodsiad
Copy link
Contributor

// using scala 3.1.0
// using lib org.virtuslab::scala-yaml:0.0.4

import org.virtuslab.yaml.*

case class Foo(int: Int, string: String) derives YamlCodec

val foo =
"""|- int: 1
   |  string: "1"
   |""".stripMargin.as[List[Option[Foo]]]

println(foo)

yields

Left(ConstructError(Could't construct scala.Option from CoreSchemaTag(tag:yaml.org,2002:map)
  string: "1"
  ^
))
@kpodsiad kpodsiad added the bug Something isn't working label Dec 30, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant