blob: 09f65bfca57dee8a27baeb0e548a946a9488dafb [file] [log] [blame]
# DO NOT EDIT; generated by go run testdata/gen.go
#
#name: non-closed definition carries over closedness to enclosed template
#evalPartial
-- in.cue --
#S: {
[string]: {a: int}
}
a: #S & {
v: {b: int}
}
#Q: {
[string]: {a: int} | {b: int}
}
b: #Q & {
w: {c: int}
}
#R: {
[string]: [{a: int}, {b: int}]
}
c: #R & {
w: [{d: int}, ...]
}
-- out/def --
#S: {
[string]: {
a: int
}
}
a: #S & {
v: {
b: int
}
}
b: #Q & {
w: {
c: int
}
}
#Q: {
[string]: {
a: int
} | {
b: int
}
}
c: #R & {
w: [{
d: int
}, ...]
}
#R: {
[string]: [{
a: int
}, {
b: int
}]
}
-- out/legacy-debug --
<0>{#S: <1>{[]: <2>(_: string)-><3>C{a: int}, }, a: <4>{[]: <5>(_: string)-><6>C{a: int}, v: _|_(int:field "b" not allowed in closed struct)}, b: <7>{[]: <8>(_: string)->(<9>C{a: int} | <10>C{b: int}), w: _|_(int:empty disjunction: field "c" not allowed in closed struct)}, #Q: <11>{[]: <12>(_: string)->(<13>C{a: int} | <14>C{b: int}), }, c: <15>{[]: <16>(_: string)->[<17>C{a: int},<18>C{b: int}], w: [_|_(int:field "d" not allowed in closed struct),<19>C{b: int}]}, #R: <20>{[]: <21>(_: string)->[<22>C{a: int},<23>C{b: int}], }}
-- out/compile --
--- in.cue
{
#S: {
[string]: {
a: int
}
}
a: (〈0;#S & {
v: {
b: int
}
})
#Q: {
[string]: ({
a: int
}|{
b: int
})
}
b: (〈0;#Q & {
w: {
c: int
}
})
#R: {
[string]: [
{
a: int
},
{
b: int
},
]
}
c: (〈0;#R & {
w: [
{
d: int
},
...,
]
})
}
-- out/eval --
Errors:
a.v: field `b` not allowed
b.w: field `c` not allowed
c.w.0: field `d` not allowed
Result:
(_|_){
// [eval]
#S: (#struct){
}
a: (_|_){
// [eval]
v: (_|_){
// [eval] a.v: field `b` not allowed
b: (int){ int }
a: (int){ int }
}
}
#Q: (#struct){
}
b: (_|_){
// [eval]
w: (_|_){
// [eval] b.w: field `c` not allowed
c: (int){ int }
b: (int){ int }
}
}
#R: (#struct){
}
c: (_|_){
// [eval]
w: (_|_){
// [eval]
0: (_|_){
// [eval] c.w.0: field `d` not allowed
d: (int){ int }
a: (int){ int }
}
1: (#struct){
b: (int){ int }
}
}
}
}