-- in.cue -- a: { {{ b c d: b e: c }} c: {} } b: { } s: "foo" c: s // s is technically in a new struct here so it will have a one higher count than // the one before. d: [s]: 3 e: {} e & {// Is this allowed? Probably not as per comprehension rule (ref fixes.) e: {} } {X=["foo"]: b: X | null} {[Y="bar"]: b: Y} let B = {open: int} f: B schema: { next: _schema_1 } let _schema_1 = schema -- out/compile -- --- in.cue { a: { { { 〈3;b〉 〈2;c〉 d: 〈3;b〉 e: 〈2;c〉 } } c: {} } b: {} s: "foo" c: 〈0;s〉 d: { [〈1;s〉]: 3 } e: {} (〈0;e〉 & { e: {} }) { ["foo"]: { b: (〈1;(〈0;-〉)〉|null) } } { ["bar"]: { b: 〈1;-〉 } } let B#1 = { open: int } f: 〈0;let B#1〉 schema: { next: 〈1;let _schema_1#2〉 } let _schema_1#2 = 〈0;schema〉 } -- out/eval/stats -- Leaks: 2 Freed: 48 Reused: 45 Allocs: 5 Retain: 8 Unifications: 50 Conjuncts: 102 Disjuncts: 54 -- out/eval -- Errors: schema.next: structural cycle Result: (_|_){ // [structural cycle] a: (struct){ d: (struct){ } e: (struct){ } c: (struct){ } } b: (struct){ } s: (string){ "foo" } c: (string){ "foo" } d: (struct){ } e: (struct){ } let B#1 = (struct){ open: (int){ int } } f: (struct){ open: (int){ int } } schema: (_|_){ // [structural cycle] next: (_|_){ // [structural cycle] schema.next: structural cycle } } let _schema_1#2 = (_|_){ // [structural cycle] _schema_1: structural cycle: // ./in.cue:32:8 } }