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

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