Skip to content

cddl-derive recursive types have infinite size #554

@ok-nick

Description

@ok-nick

When two CDDL rules reference each other cyclically, cddl-derive emits code that errors in Rust. Ideally it should box one of the types deterministically.

Repro:

node = {
  ? "name": tstr,
  ? "child": child,
}

child = {
  ? "value": int,
  ? "parent": node,
}

Error: recursive types `Node` and `Child` have infinite size

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions