cuelang.org/go@v0.13.0/cue/testdata/resolve/017_disjunctions_of_lists.txtar (about)

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