Skip to content

List not recursive for YamlWriter #30

@siddhartha-gadgil

Description

@siddhartha-gadgil

When I define a custom YamlWriter, one for the list is not automatically generated. Here is a session (in an ammonite repl).

@ case object blah 
defined object blah

@ implicit object BlahWriter extends YamlWriter[blah.type]{
  def write(c: blah.type) = YamlObject(YamlString("blah") -> YamlString(1.toString))
  }  
defined object BlahWriter

@ blah.toYaml 
res4: YamlValue = YamlObject(Map(YamlString("blah") -> YamlString("1")))

@ List(blah, blah).toYaml 
cmd5.sc:1: Cannot find YamlWriter or YamlFormat type class for List[ammonite.$sess.cmd2.blah.type]
val res5 = List(blah, blah).toYaml
                            ^
Compilation Failed

I would be happy to submit a pull request fixing this if it is not fixed yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions