cuelang.org/go@v0.13.0/cue/testdata/fulleval/042_cross-dependent_comprehension.txtar (about)

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