Skip to content
TE213 · Type · error

Invalid or heterogeneous syntax spread

A `${..values}` spread received something other than a list or tuple of syntax nodes from one compatible category.

Why this fires

A ${..values} spread did not receive a list or tuple of syntax nodes, or the collection mixed incompatible syntax categories. Spreads are structural: a member list may contain Syntax<.Member>, but not expressions or plain strings.

Fix it

Map each source value to the same quote category before spreading it.

let methods = info.fields.map(|field| {
  return quote member { fn generated(self) {} }
})
return quote items { impl ${info.ref} { ${..methods} } }

See also

Search Zolo

9 results

en