github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/cue/testdata/eval/closed_disjunction.txtar (about) 1 -- in.cue -- 2 #A: { 3 b?: int 4 *{} | {c?: int} | {d?: int} | {e?: int} 5 } 6 7 a: #A & { 8 b: 3 9 c: 3 10 } 11 12 b: #A & { 13 c: 3 14 d: 4 15 } 16 -- out/eval -- 17 Errors: 18 b: 2 errors in empty disjunction: 19 b: field not allowed: c: 20 ./in.cue:1:5 21 ./in.cue:3:2 22 ./in.cue:3:3 23 ./in.cue:11:4 24 ./in.cue:12:2 25 b: field not allowed: d: 26 ./in.cue:1:5 27 ./in.cue:3:2 28 ./in.cue:3:8 29 ./in.cue:11:4 30 ./in.cue:13:2 31 32 Result: 33 (_|_){ 34 // [eval] 35 #A: (#struct){ |(*(#struct){ 36 }, (#struct){ 37 }, (#struct){ 38 }, (#struct){ 39 }) } 40 a: (#struct){ 41 b: (int){ 3 } 42 c: (int){ 3 } 43 } 44 b: (_|_){ 45 // [eval] b: 2 errors in empty disjunction: 46 // b: field not allowed: c: 47 // ./in.cue:1:5 48 // ./in.cue:3:2 49 // ./in.cue:3:3 50 // ./in.cue:11:4 51 // ./in.cue:12:2 52 // b: field not allowed: d: 53 // ./in.cue:1:5 54 // ./in.cue:3:2 55 // ./in.cue:3:8 56 // ./in.cue:11:4 57 // ./in.cue:13:2 58 c: (_|_){ 59 // [eval] b: field not allowed: c: 60 // ./in.cue:1:5 61 // ./in.cue:3:2 62 // ./in.cue:3:32 63 // ./in.cue:11:4 64 // ./in.cue:12:2 65 } 66 d: (_|_){ 67 // [eval] b: field not allowed: d: 68 // ./in.cue:1:5 69 // ./in.cue:3:2 70 // ./in.cue:3:32 71 // ./in.cue:11:4 72 // ./in.cue:13:2 73 } 74 } 75 } 76 -- out/compile -- 77 --- in.cue 78 { 79 #A: { 80 b?: int 81 (*{}|{ 82 c?: int 83 }|{ 84 d?: int 85 }|{ 86 e?: int 87 }) 88 } 89 a: (ć0;#Ać & { 90 b: 3 91 c: 3 92 }) 93 b: (ć0;#Ać & { 94 c: 3 95 d: 4 96 }) 97 }