cuelang.org/go@v0.13.0/cue/testdata/resolve/022_list_unification.txtar (about)

     1  #name: list unification
     2  #evalPartial
     3  -- in.cue --
     4  a: {l: ["foo", v], v: l[1]}
     5  b: a & {l: [_, "bar"]}
     6  -- out/def --
     7  a: {
     8  	l: ["foo", v]
     9  	v: l[1]
    10  }
    11  b: a & {
    12  	l: [_, "bar"]
    13  }
    14  -- out/legacy-debug --
    15  <0>{a: <1>{l: ["foo",<2>.v], v: <2>.l[1]}, b: <3>{l: ["foo","bar"], v: "bar"}}
    16  -- out/compile --
    17  --- in.cue
    18  {
    19    a: {
    20      l: [
    21        "foo",
    22        〈1;v〉,
    23      ]
    24      v: 〈0;l〉[1]
    25    }
    26    b: (〈0;a〉 & {
    27      l: [
    28        _,
    29        "bar",
    30      ]
    31    })
    32  }
    33  -- out/eval/stats --
    34  Leaks:  0
    35  Freed:  11
    36  Reused: 6
    37  Allocs: 5
    38  Retain: 2
    39  
    40  Unifications: 11
    41  Conjuncts:    20
    42  Disjuncts:    13
    43  -- out/eval --
    44  (struct){
    45    a: (struct){
    46      l: (#list){
    47        0: (string){ "foo" }
    48        1: (_){ _ }
    49      }
    50      v: (_){ _ }
    51    }
    52    b: (struct){
    53      l: (#list){
    54        0: (string){ "foo" }
    55        1: (string){ "bar" }
    56      }
    57      v: (string){ "bar" }
    58    }
    59  }