| # 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 not allowed: b: |
| ./in.cue:2:12 |
| ./in.cue:4:4 |
| ./in.cue:5:6 |
| b.w: 1 errors in empty disjunction: |
| b.w: field not allowed: c: |
| ./in.cue:8:12 |
| ./in.cue:10:4 |
| ./in.cue:11:6 |
| c.w.0: field not allowed: d: |
| ./in.cue:14:12 |
| ./in.cue:14:13 |
| ./in.cue:16:4 |
| ./in.cue:17:7 |
| |
| Result: |
| (_|_){ |
| // [eval] |
| #S: (#struct){ |
| } |
| a: (_|_){ |
| // [eval] |
| v: (_|_){ |
| // [eval] |
| b: (_|_){ |
| // [eval] a.v: field not allowed: b: |
| // ./in.cue:2:12 |
| // ./in.cue:4:4 |
| // ./in.cue:5:6 |
| } |
| a: (int){ int } |
| } |
| } |
| #Q: (#struct){ |
| } |
| b: (_|_){ |
| // [eval] |
| w: (_|_){ |
| // [eval] b.w: 1 errors in empty disjunction: |
| // b.w: field not allowed: c: |
| // ./in.cue:8:12 |
| // ./in.cue:10:4 |
| // ./in.cue:11:6 |
| c: (_|_){ |
| // [eval] b.w: field not allowed: c: |
| // ./in.cue:8:12 |
| // ./in.cue:8:23 |
| // ./in.cue:10:4 |
| // ./in.cue:11:6 |
| } |
| b: (int){ int } |
| } |
| } |
| #R: (#struct){ |
| } |
| c: (_|_){ |
| // [eval] |
| w: (_|_){ |
| // [eval] |
| 0: (_|_){ |
| // [eval] |
| d: (_|_){ |
| // [eval] c.w.0: field not allowed: d: |
| // ./in.cue:14:12 |
| // ./in.cue:14:13 |
| // ./in.cue:16:4 |
| // ./in.cue:17:7 |
| } |
| a: (int){ int } |
| } |
| 1: (#struct){ |
| b: (int){ int } |
| } |
| } |
| } |
| } |