cuelang.org/go@v0.13.0/cue/testdata/definitions/038_continue_recursive_closing_for_optionals.txtar (about) 1 #name: continue recursive closing for optionals 2 #evalFull 3 -- in.cue -- 4 #S: { 5 [string]: {a: int} 6 } 7 a: #S & { 8 v: {b: int} 9 } 10 -- out/def -- 11 #S: { 12 [string]: { 13 a: int 14 } 15 } 16 a: #S & { 17 v: { 18 b: int 19 } 20 } 21 -- out/legacy-debug -- 22 <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)}} 23 -- out/compile -- 24 --- in.cue 25 { 26 #S: { 27 [string]: { 28 a: int 29 } 30 } 31 a: (〈0;#S〉 & { 32 v: { 33 b: int 34 } 35 }) 36 } 37 -- out/eval/stats -- 38 Leaks: 0 39 Freed: 6 40 Reused: 2 41 Allocs: 4 42 Retain: 0 43 44 Unifications: 6 45 Conjuncts: 9 46 Disjuncts: 6 47 -- out/evalalpha -- 48 Errors: 49 a.v.b: field not allowed: 50 ./in.cue:5:6 51 52 Result: 53 (_|_){ 54 // [eval] 55 #S: (#struct){ 56 } 57 a: (_|_){ 58 // [eval] 59 v: (_|_){ 60 // [eval] 61 b: (_|_){ 62 // [eval] a.v.b: field not allowed: 63 // ./in.cue:5:6 64 } 65 a: (int){ int } 66 } 67 } 68 } 69 -- diff/-out/evalalpha<==>+out/eval -- 70 diff old new 71 --- old 72 +++ new 73 @@ -1,7 +1,5 @@ 74 Errors: 75 a.v.b: field not allowed: 76 - ./in.cue:2:12 77 - ./in.cue:4:4 78 ./in.cue:5:6 79 80 Result: 81 @@ -15,8 +13,6 @@ 82 // [eval] 83 b: (_|_){ 84 // [eval] a.v.b: field not allowed: 85 - // ./in.cue:2:12 86 - // ./in.cue:4:4 87 // ./in.cue:5:6 88 } 89 a: (int){ int } 90 -- diff/todo/p2 -- 91 Missing positions. 92 -- out/eval -- 93 Errors: 94 a.v.b: field not allowed: 95 ./in.cue:2:12 96 ./in.cue:4:4 97 ./in.cue:5:6 98 99 Result: 100 (_|_){ 101 // [eval] 102 #S: (#struct){ 103 } 104 a: (_|_){ 105 // [eval] 106 v: (_|_){ 107 // [eval] 108 b: (_|_){ 109 // [eval] a.v.b: field not allowed: 110 // ./in.cue:2:12 111 // ./in.cue:4:4 112 // ./in.cue:5:6 113 } 114 a: (int){ int } 115 } 116 } 117 }