github.com/solo-io/cue@v0.4.7/cue/testdata/fulleval/009_template_unification_within_one_struct.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: template unification within one struct
     4  #evalFull
     5  -- in.cue --
     6  a: {
     7  	{[A=string]: {name: A}}
     8  
     9  	// TODO: allow duplicate alias here
    10  	{[X=string]: {kind: X}}
    11  }
    12  a: "A": _
    13  a: "C": _
    14  a: "E": {c: "bar"}
    15  -- out/def --
    16  a: {
    17  	{[A=string]: {
    18  		name: A, kind: A
    19  	}}
    20  	E: {
    21  		name: "E"
    22  		kind: "E"
    23  		c:    "bar"
    24  	}
    25  	A: {
    26  		name: "A"
    27  		kind: "A"
    28  	}
    29  	C: {
    30  		name: "C"
    31  		kind: "C"
    32  	}
    33  }
    34  -- out/export --
    35  a: {
    36  	E: {
    37  		name: "E"
    38  		kind: "E"
    39  		c:    "bar"
    40  	}
    41  	A: {
    42  		name: "A"
    43  		kind: "A"
    44  	}
    45  	C: {
    46  		name: "C"
    47  		kind: "C"
    48  	}
    49  }
    50  -- out/yaml --
    51  a:
    52    E:
    53      name: E
    54      kind: E
    55      c: bar
    56    A:
    57      name: A
    58      kind: A
    59    C:
    60      name: C
    61      kind: C
    62  -- out/json --
    63  {"a":{"E":{"name":"E","kind":"E","c":"bar"},"A":{"name":"A","kind":"A"},"C":{"name":"C","kind":"C"}}}
    64  -- out/legacy-debug --
    65  <0>{a: <1>{[]: <2>(A: string)->(<3>{name: <2>.A} & <4>{kind: <2>.A}), E: <5>{name: "E", kind: "E", c: "bar"}, A: <6>{name: "A", kind: "A"}, C: <7>{name: "C", kind: "C"}}}
    66  -- out/compile --
    67  --- in.cue
    68  {
    69    a: {
    70      {
    71        [string]: {
    72          name: 〈1;-〉
    73        }
    74      }
    75      {
    76        [string]: {
    77          kind: 〈1;-〉
    78        }
    79      }
    80    }
    81    a: {
    82      A: _
    83    }
    84    a: {
    85      C: _
    86    }
    87    a: {
    88      E: {
    89        c: "bar"
    90      }
    91    }
    92  }
    93  -- out/eval --
    94  (struct){
    95    a: (struct){
    96      A: (struct){
    97        name: (string){ "A" }
    98        kind: (string){ "A" }
    99      }
   100      C: (struct){
   101        name: (string){ "C" }
   102        kind: (string){ "C" }
   103      }
   104      E: (struct){
   105        c: (string){ "bar" }
   106        name: (string){ "E" }
   107        kind: (string){ "E" }
   108      }
   109    }
   110  }