cuelang.org/go@v0.13.0/cue/testdata/cycle/issue241.txtar (about)

     1  -- in.cue --
     2  #Value: 0 | 1
     3  
     4  foo: #Value
     5  foo: !=bar
     6  bar: #Value
     7  bar: !=foo
     8  
     9  #Value: 0 | 1
    10  
    11  Foo: #Value
    12  Foo: !=Bar
    13  Bar: #Value
    14  Bar: !=Foo
    15  Bar: 0
    16  
    17  cell: a: 0 | 1
    18  cell: a: !=cell.b
    19  cell: b: 0 | 1
    20  cell: b: !=cell.a
    21  cell: a: 0
    22  cell: b: _
    23  
    24  a: cell.a
    25  b: cell.b
    26  -- out/eval/stats --
    27  Leaks:  0
    28  Freed:  47
    29  Reused: 39
    30  Allocs: 8
    31  Retain: 7
    32  
    33  Unifications: 11
    34  Conjuncts:    101
    35  Disjuncts:    47
    36  -- out/evalalpha --
    37  (struct){
    38    #Value: (int){ |((int){ 0 }, (int){ 1 }) }
    39    foo: (_|_){
    40      // [cycle] foo: cycle across unresolved disjunction referenced by bar:
    41      //     ./in.cue:1:13
    42      //     ./in.cue:5:6
    43      //     ./in.cue:6:6
    44    }
    45    bar: (int){ |((int){ 0 }, (int){ 1 }) }
    46    Foo: (int){ 1 }
    47    Bar: (int){ 0 }
    48    cell: (struct){
    49      a: (int){ 0 }
    50      b: (int){ 1 }
    51    }
    52    a: (int){ 0 }
    53    b: (int){ 1 }
    54  }
    55  -- diff/-out/evalalpha<==>+out/eval --
    56  diff old new
    57  --- old
    58  +++ new
    59  @@ -1,8 +1,10 @@
    60   (struct){
    61     #Value: (int){ |((int){ 0 }, (int){ 1 }) }
    62     foo: (_|_){
    63  -    // [incomplete] foo: unresolved disjunction 0 | 1 (type int):
    64  -    //     ./in.cue:4:6
    65  +    // [cycle] foo: cycle across unresolved disjunction referenced by bar:
    66  +    //     ./in.cue:1:13
    67  +    //     ./in.cue:5:6
    68  +    //     ./in.cue:6:6
    69     }
    70     bar: (int){ |((int){ 0 }, (int){ 1 }) }
    71     Foo: (int){ 1 }
    72  -- diff/explanation --
    73  error is now symmetric
    74  -- out/eval --
    75  (struct){
    76    #Value: (int){ |((int){ 0 }, (int){ 1 }) }
    77    foo: (_|_){
    78      // [incomplete] foo: unresolved disjunction 0 | 1 (type int):
    79      //     ./in.cue:4:6
    80    }
    81    bar: (int){ |((int){ 0 }, (int){ 1 }) }
    82    Foo: (int){ 1 }
    83    Bar: (int){ 0 }
    84    cell: (struct){
    85      a: (int){ 0 }
    86      b: (int){ 1 }
    87    }
    88    a: (int){ 0 }
    89    b: (int){ 1 }
    90  }
    91  -- out/compile --
    92  --- in.cue
    93  {
    94    #Value: (0|1)
    95    foo: 〈0;#Value〉
    96    foo: !=〈0;bar〉
    97    bar: 〈0;#Value〉
    98    bar: !=〈0;foo〉
    99    #Value: (0|1)
   100    Foo: 〈0;#Value〉
   101    Foo: !=〈0;Bar〉
   102    Bar: 〈0;#Value〉
   103    Bar: !=〈0;Foo〉
   104    Bar: 0
   105    cell: {
   106      a: (0|1)
   107    }
   108    cell: {
   109      a: !=〈1;cell〉.b
   110    }
   111    cell: {
   112      b: (0|1)
   113    }
   114    cell: {
   115      b: !=〈1;cell〉.a
   116    }
   117    cell: {
   118      a: 0
   119    }
   120    cell: {
   121      b: _
   122    }
   123    a: 〈0;cell〉.a
   124    b: 〈0;cell〉.b
   125  }