# TODO: revert to cue eval -i post fix for #1786
! exec cue eval -c cycle.cue
cmp stderr expect-stderr

-- frontmatter.toml --
title = "Reference Cycles"
description = ""

-- text.md --
CUE can handle many types of cycles just fine.
Because all values are final, a field with a concrete value of, say `200`,
can only be valid if it is that value.
So if it is unified with another expression, we can delay the evaluation of
this until later.

By postponing that evaluation, we can often break cycles.
This is very useful for template writers that may not know what fields
a user will want to fill out.

-- cycle.cue --
// CUE knows how to resolve the following:
x: 200
x: y + 100
y: x - 100

// If a cycle is not broken, CUE will just report it.
a: b + 100
b: a - 100

-- expect-stderr --
cycle error:
    ./cycle.cue:7:4
