cuelang.org/go@v0.13.0/cue/testdata/fulleval/030_retain_references_with_interleaved_embedding.txtar (about)

     1  #name: retain references with interleaved embedding
     2  #evalFull
     3  -- in.cue --
     4  a: d: {
     5  	#base
     6  	#info: {...}
     7  	Y: #info.X
     8  }
     9  
    10  #base: {
    11  	#info: {...}
    12  }
    13  
    14  a: [Name=string]: {#info: {
    15  	X: "foo"
    16  }}
    17  -- out/def --
    18  a: {
    19  	{[Name=string]: {
    20  		#info: {
    21  			X: "foo"
    22  		}
    23  	}}
    24  	d: {
    25  		#info: {
    26  			...
    27  		}
    28  		Y: #info.X
    29  		#base
    30  	}
    31  }
    32  #base: {
    33  	#info: {
    34  		...
    35  	}
    36  }
    37  -- out/export --
    38  a: {
    39  	d: {
    40  		Y: "foo"
    41  	}
    42  }
    43  -- out/yaml --
    44  a:
    45    d:
    46      Y: foo
    47  -- out/json --
    48  {"a":{"d":{"Y":"foo"}}}
    49  -- out/legacy-debug --
    50  <0>{a: <1>{[]: <2>(Name: string)-><3>{#info: <4>C{X: "foo"}}, d: <5>C{#info: <6>C{X: "foo"}, Y: "foo"}}, #base: <7>C{#info: <8>{...}}}
    51  -- out/compile --
    52  --- in.cue
    53  {
    54    a: {
    55      d: {
    56        〈2;#base〉
    57        #info: {
    58          ...
    59        }
    60        Y: 〈0;#info〉.X
    61      }
    62    }
    63    #base: {
    64      #info: {
    65        ...
    66      }
    67    }
    68    a: {
    69      [string]: {
    70        #info: {
    71          X: "foo"
    72        }
    73      }
    74    }
    75  }
    76  -- out/eval/stats --
    77  Leaks:  0
    78  Freed:  8
    79  Reused: 3
    80  Allocs: 5
    81  Retain: 1
    82  
    83  Unifications: 8
    84  Conjuncts:    19
    85  Disjuncts:    9
    86  -- out/eval --
    87  (struct){
    88    a: (struct){
    89      d: (#struct){
    90        #info: (#struct){
    91          X: (string){ "foo" }
    92        }
    93        Y: (string){ "foo" }
    94      }
    95    }
    96    #base: (#struct){
    97      #info: (#struct){
    98      }
    99    }
   100  }