...

Text file src/cuelang.org/go/cue/testdata/comprehensions/lists.txtar

Documentation: cuelang.org/go/cue/testdata/comprehensions

     1-- in.cue --
     2a: [{a: 1}, {b: 2 & 3}]
     3
     4b: [for x in a {x}]
     5-- out/eval/stats --
     6Leaks:  0
     7Freed:  7
     8Reused: 3
     9Allocs: 4
    10Retain: 0
    11
    12Unifications: 7
    13Conjuncts:    8
    14Disjuncts:    7
    15-- out/eval --
    16Errors:
    17a.1.b: conflicting values 3 and 2:
    18    ./in.cue:1:17
    19    ./in.cue:1:21
    20
    21Result:
    22(_|_){
    23  // [eval]
    24  a: (_|_){
    25    // [eval]
    26    0: (struct){
    27      a: (int){ 1 }
    28    }
    29    1: (_|_){
    30      // [eval]
    31      b: (_|_){
    32        // [eval] a.1.b: conflicting values 3 and 2:
    33        //     ./in.cue:1:17
    34        //     ./in.cue:1:21
    35      }
    36    }
    37  }
    38  b: (_|_){
    39    // [eval] a.1.b: conflicting values 3 and 2:
    40    //     ./in.cue:1:17
    41    //     ./in.cue:1:21
    42  }
    43}
    44-- out/compile --
    45--- in.cue
    46{
    47  a: [
    48    {
    49      a: 1
    50    },
    51    {
    52      b: (2 & 3)
    53    },
    54  ]
    55  b: [
    56    for _, x in 怈1;a怉 {
    57      怈1;x怉
    58    },
    59  ]
    60}

View as plain text