cuelang.org/go@v0.13.0/cue/testdata/fulleval/007_different_labels_for_templates.txtar (about)

     1  #name: different labels for templates
     2  #evalFull
     3  -- in.cue --
     4  a: [X=string]: {name: X}
     5  a: [Name=string]: {name: Name}
     6  a: foo: {}
     7  -- out/def --
     8  a: {
     9  	{[X=string]: {
    10  		name: X & X
    11  	}}
    12  	foo: {
    13  		name: "foo"
    14  	}
    15  }
    16  -- out/export --
    17  a: {
    18  	foo: {
    19  		name: "foo"
    20  	}
    21  }
    22  -- out/yaml --
    23  a:
    24    foo:
    25      name: foo
    26  -- out/json --
    27  {"a":{"foo":{"name":"foo"}}}
    28  -- out/legacy-debug --
    29  <0>{a: <1>{[]: <2>(X: string)->(<3>{name: <2>.X} & <4>{name: <2>.X}), foo: <5>{name: "foo"}}}
    30  -- out/compile --
    31  --- in.cue
    32  {
    33    a: {
    34      [string]: {
    35        name: 〈1;-〉
    36      }
    37    }
    38    a: {
    39      [string]: {
    40        name: 〈1;-〉
    41      }
    42    }
    43    a: {
    44      foo: {}
    45    }
    46  }
    47  -- out/eval/stats --
    48  Leaks:  0
    49  Freed:  4
    50  Reused: 0
    51  Allocs: 4
    52  Retain: 0
    53  
    54  Unifications: 4
    55  Conjuncts:    9
    56  Disjuncts:    4
    57  -- out/eval --
    58  (struct){
    59    a: (struct){
    60      foo: (struct){
    61        name: (string){ "foo" }
    62      }
    63    }
    64  }