# XO0427: xml.decode of a type parameter

A call of `xml.encode_value` or `xml.decode` is compiled as a call of the function `derive Xml` generates for its struct, so the type must be known where it is called. Call it with the struct, or take the decoder as a function value. See core 2.9.

## Example

```xo
fn read[T: Xml](s: Str) -> T ! xml.XmlErr {
  xml.decode[T](s)
}
```

## Fix

```xo
fn read_item(s: Str) -> Item ! xml.XmlErr {
  xml.decode[Item](s)
}
```

Run `xo explain XO0427` for this text in a terminal, or see
[section 10.6 of the specification](../../spec/core/#106-diagnostic-codes).

