cuelang.org/go@v0.13.0/cue/testdata/resolve/033_top-level_definition_with_struct_and_disjunction.txtar (about)

     1  #name: top-level definition with struct and disjunction
     2  #evalPartial
     3  -- in.cue --
     4  #def: {
     5  	Type: string
     6  	Text: string
     7  	Size: int
     8  }
     9  
    10  #def: {
    11  	Type: "B"
    12  	Size: 0
    13  } | {
    14  	Type: "A"
    15  	Size: 1
    16  }
    17  -- out/def --
    18  #def: {
    19  	Size: 0
    20  	Type: "B"
    21  	Text: string
    22  } | {
    23  	Size: 1
    24  	Type: "A"
    25  	Text: string
    26  }
    27  -- out/export --
    28  
    29  -- out/yaml --
    30  {}
    31  -- out/json --
    32  {}
    33  -- out/legacy-debug --
    34  <0>{#def: (<1>C{Size: (0 & int), Type: ("B" & string), Text: string} | <2>C{Size: (1 & int), Type: ("A" & string), Text: string})}
    35  -- out/compile --
    36  --- in.cue
    37  {
    38    #def: {
    39      Type: string
    40      Text: string
    41      Size: int
    42    }
    43    #def: ({
    44      Type: "B"
    45      Size: 0
    46    }|{
    47      Type: "A"
    48      Size: 1
    49    })
    50  }
    51  -- out/eval/stats --
    52  Leaks:  0
    53  Freed:  10
    54  Reused: 5
    55  Allocs: 5
    56  Retain: 0
    57  
    58  Unifications: 8
    59  Conjuncts:    15
    60  Disjuncts:    10
    61  -- out/eval --
    62  (struct){
    63    #def: (#struct){ |((#struct){
    64        Type: (string){ "B" }
    65        Text: (string){ string }
    66        Size: (int){ 0 }
    67      }, (#struct){
    68        Type: (string){ "A" }
    69        Text: (string){ string }
    70        Size: (int){ 1 }
    71      }) }
    72  }