| -- in.cue -- |
| #A: { |
| b?: int |
| *{} | {c?: int} | {d?: int} | {e?: int} |
| } |
| |
| a: #A & { |
| b: 3 |
| c: 3 |
| } |
| |
| b: #A & { |
| c: 3 |
| d: 4 |
| } |
| -- out/eval -- |
| Errors: |
| b: 2 errors in empty disjunction: |
| b: field c not allowed: |
| ./in.cue:1:5 |
| ./in.cue:3:5 |
| ./in.cue:3:6 |
| ./in.cue:11:4 |
| ./in.cue:12:5 |
| b: field d not allowed: |
| ./in.cue:1:5 |
| ./in.cue:3:5 |
| ./in.cue:3:11 |
| ./in.cue:11:4 |
| ./in.cue:13:5 |
| |
| Result: |
| (_|_){ |
| // [eval] |
| #A: (struct){ |(*(#struct){ |
| }, (#struct){ |
| }, (#struct){ |
| }, (#struct){ |
| }) } |
| a: (#struct){ |
| b: (int){ 3 } |
| c: (int){ 3 } |
| } |
| b: (_|_){ |
| // [eval] b: 2 errors in empty disjunction: |
| // b: field c not allowed: |
| // ./in.cue:1:5 |
| // ./in.cue:3:5 |
| // ./in.cue:3:6 |
| // ./in.cue:11:4 |
| // ./in.cue:12:5 |
| // b: field d not allowed: |
| // ./in.cue:1:5 |
| // ./in.cue:3:5 |
| // ./in.cue:3:11 |
| // ./in.cue:11:4 |
| // ./in.cue:13:5 |
| c: (_|_){ |
| // [eval] b: field c not allowed: |
| // ./in.cue:1:5 |
| // ./in.cue:3:5 |
| // ./in.cue:3:35 |
| // ./in.cue:11:4 |
| // ./in.cue:12:5 |
| } |
| d: (_|_){ |
| // [eval] b: field d not allowed: |
| // ./in.cue:1:5 |
| // ./in.cue:3:5 |
| // ./in.cue:3:35 |
| // ./in.cue:11:4 |
| // ./in.cue:13:5 |
| } |
| } |
| } |
| -- out/compile -- |
| --- in.cue |
| { |
| #A: { |
| b?: int |
| (*{}|{ |
| c?: int |
| }|{ |
| d?: int |
| }|{ |
| e?: int |
| }) |
| } |
| a: (〈0;#A〉 & { |
| b: 3 |
| c: 3 |
| }) |
| b: (〈0;#A〉 & { |
| c: 3 |
| d: 4 |
| }) |
| } |