...

Text file src/cuelang.org/go/cue/testdata/definitions/issue419.txtar

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

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

View as plain text