# DO NOT EDIT; generated by go run testdata/gen.go | |
# | |
#name: incomplete comprehensions | |
#evalPartial | |
-- in.cue -- | |
A: { | |
for v in src { | |
"\(v)": v | |
} | |
src: _ | |
if true { | |
baz: "baz" | |
} | |
} | |
B: A & { | |
src: ["foo", "bar"] | |
} | |
-- out/def -- | |
A: { | |
src: _ | |
baz: "baz" | |
for v in src { | |
"\(v)": v | |
} | |
} | |
B: A & { | |
src: ["foo", "bar"] | |
} | |
-- out/legacy-debug -- | |
<0>{A: <1>{src: _, baz: "baz" <2>for _, v in <3>.src yield <4>{""+<2>.v+"": <2>.v}}, B: <5>{src: ["foo","bar"], baz: "baz", foo: "foo", bar: "bar"}} | |
-- out/compile -- | |
--- in.cue | |
{ | |
A: { | |
for _, v in 〈0;src〉 { | |
"\(〈1;v〉)": 〈1;v〉 | |
} | |
src: _ | |
if true { | |
baz: "baz" | |
} | |
} | |
B: (〈0;A〉 & { | |
src: [ | |
"foo", | |
"bar", | |
] | |
}) | |
} | |
-- out/eval -- | |
(struct){ | |
A: (_|_){ | |
// [incomplete] A: cannot range over src (incomplete type _): | |
// ./in.cue:2:11 | |
src: (_){ _ } | |
baz: (string){ "baz" } | |
} | |
B: (struct){ | |
src: (#list){ | |
0: (string){ "foo" } | |
1: (string){ "bar" } | |
} | |
baz: (string){ "baz" } | |
foo: (string){ "foo" } | |
bar: (string){ "bar" } | |
} | |
} |