cue eval ./struct.cue
cmp stderr expect-stderr
cmp stdout expect-stdout
-- struct.cue --
#type: {
    x: 0
    y: 0

    if x == 0 {i: 0}
    if y == 0 {j: 0}
}

data: {
    a: #type
    b: #type

    b: x: a.x
    a: y: b.y
}
-- expect-stderr --
-- expect-stdout --
#type: {
    x: 0
    i: 0
    j: 0
    y: 0
}
data: {
    a: {
        x: 0
        i: 0
        j: 0
        y: 0
    }
    b: {
        x: 0
        i: 0
        j: 0
        y: 0
    }
}
