# DO NOT EDIT; generated by go run testdata/gen.go | |
# | |
#name: alias reuse in nested scope | |
#evalFull | |
-- in.cue -- | |
#Foo: { | |
let X = or([ for k, _ in {} {k}]) | |
connection: [X]: X | |
} | |
#A: { | |
foo: "key" | |
let X = foo | |
a: foo: [X]: X | |
} | |
#B: { | |
foo: string | |
let X = foo | |
a: foo: [X]: X | |
} | |
b: #B & {foo: "key"} | |
-- out/def -- | |
#Foo: { | |
connection: { | |
[or([ for k, _ in { | |
... | |
} { k } ])]: or([ for k, _ in { | |
... | |
} { k } ]) | |
} | |
} | |
#A: { | |
foo: "key" | |
a: { | |
foo: { | |
["key"]: "key" | |
} | |
} | |
} | |
#B: { | |
foo: string | |
FOO = foo | |
a: { | |
foo: { | |
[FOO]: FOO | |
} | |
} | |
} | |
b: #B & { | |
foo: "key" | |
} | |
-- out/export -- | |
b: { | |
foo: "key" | |
a: { | |
foo: {} | |
} | |
} | |
-- out/yaml -- | |
b: | |
foo: key | |
a: | |
foo: {} | |
-- out/json -- | |
{"b":{"foo":"key","a":{"foo":{}}}} | |
-- out/legacy-debug -- | |
<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, }}}} | |
-- out/eval -- | |
(struct){ | |
#Foo: (#struct){ | |
connection: (#struct){ | |
} | |
} | |
#A: (#struct){ | |
foo: (string){ "key" } | |
a: (#struct){ | |
foo: (#struct){ | |
} | |
} | |
} | |
#B: (#struct){ | |
foo: (string){ string } | |
a: (#struct){ | |
foo: (#struct){ | |
} | |
} | |
} | |
b: (#struct){ | |
foo: (string){ "key" } | |
a: (#struct){ | |
foo: (#struct){ | |
} | |
} | |
} | |
} | |
-- out/compile -- | |
--- in.cue | |
{ | |
#Foo: { | |
connection: { | |
[〈1;let X〉]: 〈1;let X〉 | |
} | |
} | |
#A: { | |
foo: "key" | |
a: { | |
foo: { | |
[〈2;let X〉]: 〈2;let X〉 | |
} | |
} | |
} | |
#B: { | |
foo: string | |
a: { | |
foo: { | |
[〈2;let X〉]: 〈2;let X〉 | |
} | |
} | |
} | |
b: (〈0;#B〉 & { | |
foo: "key" | |
}) | |
} |