# 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/stats -- Leaks: 0 Freed: 9 Reused: 6 Allocs: 3 Retain: 0 Unifications: 9 Conjuncts: 29 Disjuncts: 9 -- out/evalalpha -- Errors: c.aaa: field not allowed: ./in.cue:5:18 ./in.cue:2:2 ./in.cue:9:11 d.aaa: field not allowed: ./in.cue:5:18 ./in.cue:2:2 ./in.cue:12:10 Result: (_|_){ // [eval] #A: (#struct){ } #B: (#struct){ } #C: (#struct){ } c: (_|_){ // [eval] aaa: (_|_){ // [eval] c.aaa: field not allowed: // ./in.cue:5:18 // ./in.cue:2:2 // ./in.cue:9:11 } } #D: (#struct){ } d: (_|_){ // [eval] aaa: (_|_){ // [eval] d.aaa: field not allowed: // ./in.cue:5:18 // ./in.cue:2:2 // ./in.cue:12:10 } } } -- diff/-out/evalalpha<==>+out/eval -- diff old new --- old +++ new @@ -1,18 +1,11 @@ Errors: c.aaa: field not allowed: - ./in.cue:2:2 - ./in.cue:4:5 - ./in.cue:8:5 - ./in.cue:8:10 - ./in.cue:9:5 + ./in.cue:5:18 + ./in.cue:2:2 ./in.cue:9:11 d.aaa: field not allowed: - ./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:5:18 + ./in.cue:2:2 ./in.cue:12:10 Result: @@ -28,11 +21,8 @@ // [eval] aaa: (_|_){ // [eval] c.aaa: field not allowed: - // ./in.cue:2:2 - // ./in.cue:4:5 - // ./in.cue:8:5 - // ./in.cue:8:10 - // ./in.cue:9:5 + // ./in.cue:5:18 + // ./in.cue:2:2 // ./in.cue:9:11 } } @@ -42,12 +32,8 @@ // [eval] aaa: (_|_){ // [eval] d.aaa: field not allowed: - // ./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:5:18 + // ./in.cue:2:2 // ./in.cue:12:10 } } -- diff/todo/p2 -- Missing positions. -- out/eval -- Errors: c.aaa: field not allowed: ./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.aaa: field not allowed: ./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.aaa: field not allowed: // ./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.aaa: field not allowed: // ./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 } } }