| # DO NOT EDIT; generated by go run testdata/gen.go |
| # |
| #name: conjunction of optional sets |
| #evalFull |
| -- in.cue -- |
| #A: { |
| [=~"^[a-s]*$"]: int |
| } |
| #B: { |
| [=~"^[m-z]*$"]: int |
| } |
| |
| #C: #A & #B |
| c: #C & {aaa: 3} |
| |
| #D: {#A & #B} |
| d: #D & {aaa: 3} |
| -- out/def -- |
| #A: { |
| [=~"^[a-s]*$"]: int |
| } |
| #B: { |
| [=~"^[m-z]*$"]: int |
| } |
| #C: #A & #B |
| c: _|_ // field "aaa" not allowed in closed struct |
| #D: { |
| #A & #B |
| } |
| d: _|_ // field "aaa" not allowed in closed struct |
| -- out/legacy-debug -- |
| <0>{#A: <1>C{[=~"^[a-s]*$"]: <2>(_: string)->int, }, #B: <3>C{[=~"^[m-z]*$"]: <4>(_: string)->int, }, #C: <5>C{(C{[=~"^[a-s]*$"]: <6>(_: string)->int} & C{[=~"^[m-z]*$"]: <7>(_: string)->int}), }, c: _|_(3:field "aaa" not allowed in closed struct), #D: <8>C{(C{[=~"^[a-s]*$"]: <9>(_: string)->int} & C{[=~"^[m-z]*$"]: <10>(_: string)->int}), }, d: _|_(3:field "aaa" not allowed in closed struct)} |
| -- out/compile -- |
| --- in.cue |
| { |
| #A: { |
| [=~"^[a-s]*$"]: int |
| } |
| #B: { |
| [=~"^[m-z]*$"]: int |
| } |
| #C: (〈0;#A〉 & 〈0;#B〉) |
| c: (〈0;#C〉 & { |
| aaa: 3 |
| }) |
| #D: { |
| (〈1;#A〉 & 〈1;#B〉) |
| } |
| d: (〈0;#D〉 & { |
| aaa: 3 |
| }) |
| } |
| -- out/eval -- |
| Errors: |
| c: field not allowed: aaa: |
| ./in.cue:2:2 |
| ./in.cue:4:5 |
| ./in.cue:8:5 |
| ./in.cue:8:10 |
| ./in.cue:9:5 |
| ./in.cue:9:11 |
| d: field not allowed: aaa: |
| ./in.cue:2:2 |
| ./in.cue:4:5 |
| ./in.cue:11:5 |
| ./in.cue:11:6 |
| ./in.cue:11:11 |
| ./in.cue:12:4 |
| ./in.cue:12:10 |
| |
| Result: |
| (_|_){ |
| // [eval] |
| #A: (#struct){ |
| } |
| #B: (#struct){ |
| } |
| #C: (#struct){ |
| } |
| c: (_|_){ |
| // [eval] |
| aaa: (_|_){ |
| // [eval] c: field not allowed: aaa: |
| // ./in.cue:2:2 |
| // ./in.cue:4:5 |
| // ./in.cue:8:5 |
| // ./in.cue:8:10 |
| // ./in.cue:9:5 |
| // ./in.cue:9:11 |
| } |
| } |
| #D: (#struct){ |
| } |
| d: (_|_){ |
| // [eval] |
| aaa: (_|_){ |
| // [eval] d: field not allowed: aaa: |
| // ./in.cue:2:2 |
| // ./in.cue:4:5 |
| // ./in.cue:11:5 |
| // ./in.cue:11:6 |
| // ./in.cue:11:11 |
| // ./in.cue:12:4 |
| // ./in.cue:12:10 |
| } |
| } |
| } |