blob: 65b1e39c7b1e70f1a964fb787ed8cef02162ed51 [file] [log] [blame]
# Issue #590
-- in.cue --
let X = 1 + 1
#Foo: X
-- x.cue --
x: string
let Y = x
y: Y
-- y.cue --
x: "foo"
// Note: although syntactically the same, this is a different let clause than
// the one from before and thus will be renamed.
// Issue #590
let Y = x
y: Y
-- issue593.cue --
cfgs: [ for crd in ["one", "two"] {
metadata: {
name: crd
}
}]
for cfg in cfgs {
let filepath = "kind-\(cfg.name)"
files: {
"\(filepath)": {
patches: cfg
}
}
}
-- out/definition --
{
cfgs: [ for crd in ["one", "two"] {
metadata: {
name: crd
}
}]
for cfg in cfgs {
let filepath = "kind-\(cfg.name)"
files: {
"\(filepath)": {
patches: cfg
}
}
}
}
let X = 1 + 1
#Foo: X
x: "foo"
let Y = x
let Y_1 = x
y: Y & Y_1
-- out/doc --
[]
[#Foo]
[x]
[y]
[cfgs]
[cfgs 0]
[cfgs 0 metadata]
[cfgs 0 metadata name]
[cfgs 1]
[cfgs 1 metadata]
[cfgs 1 metadata name]
[files]
-- out/value --
== Simplified
{
x: "foo"
cfgs: [{
metadata: {
name: "one"
}
}, {
metadata: {
name: "two"
}
}]
let filepath = "kind-\(cfg.name)"
files: {
"\(filepath)": {
patches: cfg
}
} & {
"\(filepath)": {
patches: cfg
}
}
y: "foo"
}
== Raw
{
#Foo: 2
x: "foo"
cfgs: [{
metadata: {
name: "one"
}
}, {
metadata: {
name: "two"
}
}]
let filepath = "kind-\(cfg.name)"
files: {
"\(filepath)": {
patches: cfg
}
} & {
"\(filepath)": {
patches: cfg
}
}
y: "foo"
}
== Final
{
x: "foo"
cfgs: [{
metadata: {
name: "one"
}
}, {
metadata: {
name: "two"
}
}]
files: _|_ // invalid interpolation: invalid interpolation: files: undefined field: name (and 3 more errors)
y: "foo"
}
== All
{
#Foo: 2
x: "foo"
cfgs: [{
metadata: {
name: "one"
}
}, {
metadata: {
name: "two"
}
}]
let filepath = "kind-\(cfg.name)"
files: {
"\(filepath)": {
patches: cfg
}
} & {
"\(filepath)": {
patches: cfg
}
}
y: "foo"
}
== Eval
{
#Foo: 2
x: "foo"
cfgs: [{
metadata: {
name: "one"
}
}, {
metadata: {
name: "two"
}
}]
let filepath = "kind-\(cfg.name)"
files: {
"\(filepath)": {
patches: cfg
}
} & {
"\(filepath)": {
patches: cfg
}
}
y: "foo"
}