cuelang.org/go@v0.13.0/cue/testdata/resolve/031_definitions_with_disjunctions_recurisive.txtar (about)

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