Xo is experimental. The source is now public on GitHub, or try Xo in your browser.
Menu · XO0425

Docs

XO0425: a field type derive Xml cannot map

error · reported by the checker

derive Xml generates Go’s Marshal and Unmarshal for the struct from its field types. A field of another type (a Map, a Time, a Bytes), a struct with type parameters, or a nested struct without derive Xml cannot be mapped. Change the field, or give the nested struct derive Xml. See core 2.9.

Example

struct Page {
  meta: Map[Str, Str]
} derive Xml

Fix

struct Page {
  title: Str
} derive Xml

Run xo explain XO0425 for this text in a terminal, or see section 10.6 of the specification.