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