cuelang.org/go@v0.13.0/cue/testdata/fulleval/001_conflicts_in_optional_fields_are_okay_.txtar (about)

     1  #name: conflicts in optional fields are okay 
     2  #evalFull
     3  -- in.cue --
     4  d: {a: 1, b?: 3} | {a: 2}
     5  
     6  // the following conjunction should not eliminate any disjuncts
     7  c: d & {b?: 4}
     8  -- out/def --
     9  d: {
    10  	a:  1
    11  	b?: 3
    12  } | {
    13  	a: 2
    14  }
    15  
    16  // the following conjunction should not eliminate any disjuncts
    17  c: d & {
    18  	b?: 4
    19  }
    20  -- out/legacy-debug --
    21  <0>{d: (<1>{a: 1, b?: 3} | <2>{a: 2}), c: (<3>{a: 1, b?: (3 & 4)} | <4>{a: 2, b?: 4})}
    22  -- out/compile --
    23  --- in.cue
    24  {
    25    d: ({
    26      a: 1
    27      b?: 3
    28    }|{
    29      a: 2
    30    })
    31    c: (〈0;d〉 & {
    32      b?: 4
    33    })
    34  }
    35  -- out/eval/stats --
    36  Leaks:  0
    37  Freed:  14
    38  Reused: 9
    39  Allocs: 5
    40  Retain: 0
    41  
    42  Unifications: 10
    43  Conjuncts:    17
    44  Disjuncts:    14
    45  -- out/evalalpha --
    46  (struct){
    47    d: (struct){ |((struct){
    48        a: (int){ 1 }
    49        b?: (int){ 3 }
    50      }, (struct){
    51        a: (int){ 2 }
    52      }) }
    53    c: (struct){ |((struct){
    54        b?: (_|_){
    55          // [eval] c.b: conflicting values 3 and 4:
    56          //     ./in.cue:1:15
    57          //     ./in.cue:4:13
    58        }
    59        a: (int){ 1 }
    60      }, (struct){
    61        b?: (int){ 4 }
    62        a: (int){ 2 }
    63      }) }
    64  }
    65  -- diff/-out/evalalpha<==>+out/eval --
    66  diff old new
    67  --- old
    68  +++ new
    69  @@ -9,7 +9,6 @@
    70         b?: (_|_){
    71           // [eval] c.b: conflicting values 3 and 4:
    72           //     ./in.cue:1:15
    73  -        //     ./in.cue:4:4
    74           //     ./in.cue:4:13
    75         }
    76         a: (int){ 1 }
    77  -- diff/todo/p3 --
    78  Missing error position.
    79  -- out/eval --
    80  (struct){
    81    d: (struct){ |((struct){
    82        a: (int){ 1 }
    83        b?: (int){ 3 }
    84      }, (struct){
    85        a: (int){ 2 }
    86      }) }
    87    c: (struct){ |((struct){
    88        b?: (_|_){
    89          // [eval] c.b: conflicting values 3 and 4:
    90          //     ./in.cue:1:15
    91          //     ./in.cue:4:4
    92          //     ./in.cue:4:13
    93        }
    94        a: (int){ 1 }
    95      }, (struct){
    96        b?: (int){ 4 }
    97        a: (int){ 2 }
    98      }) }
    99  }