# DO NOT EDIT; generated by go run testdata/gen.go # #name: closing with comprehensions #evalPartial -- in.cue -- #A: {f1: int, f2: int} for k, v in {f3: int} { a: #A & {"\(k)": v} } #B: { for k, v in {f1: int} { "\(k)": v } } #C: { f1: _ for k, v in {f1: int} { "\(k)": v } } #D: { for k, v in {f1: int} { "\(k)": v } ... } #E: #A & { for k, v in {f3: int} { "\(k)": v } } -- out/def -- #A: { f1: int f2: int } a: _|_ // field "f3" not allowed in closed struct #B: { f1: v } #C: { f1: { _ v ... } } #D: { f1: v ... } #E: _|_ // field "f3" not allowed in closed struct -- out/legacy-debug -- <0>{#A: <1>C{f1: int, f2: int}, a: _|_(<2>.v:field "f3" not allowed in closed struct), #B: <3>C{f1: int}, #C: <4>C{f1: int}, #D: <5>{f1: int, ...}, #E: _|_(<6>.v:field "f3" not allowed in closed struct)} -- out/compile -- --- in.cue { #A: { f1: int f2: int } for k, v in { f3: int } { a: (〈2;#A〉 & { "\(〈2;k〉)": 〈2;v〉 }) } #B: { for k, v in { f1: int } { "\(〈1;k〉)": 〈1;v〉 } } #C: { f1: _ for k, v in { f1: int } { "\(〈1;k〉)": 〈1;v〉 } } #D: { for k, v in { f1: int } { "\(〈1;k〉)": 〈1;v〉 } ... } #E: (〈0;#A〉 & { for k, v in { f3: int } { "\(〈1;k〉)": 〈1;v〉 } }) } -- out/eval/stats -- Leaks: 10 Freed: 18 Reused: 15 Allocs: 13 Retain: 10 Unifications: 28 Conjuncts: 43 Disjuncts: 28 -- out/evalalpha -- Errors: a.f3: field not allowed: ./in.cue:4:19 #E.f3: field not allowed: ./in.cue:29:11 Result: (_|_){ // [eval] #A: (#struct){ f1: (int){ int } f2: (int){ int } } a: (_|_){ // [eval] f1: (int){ int } f2: (int){ int } f3: (_|_){ // [eval] a.f3: field not allowed: // ./in.cue:4:19 } } #B: (#struct){ f1: (int){ int } } #C: (#struct){ f1: (int){ int } } #D: (#struct){ f1: (int){ int } } #E: (_|_){ // [eval] f1: (int){ int } f2: (int){ int } f3: (_|_){ // [eval] #E.f3: field not allowed: // ./in.cue:29:11 } } } -- diff/-out/evalalpha<==>+out/eval -- diff old new --- old +++ new @@ -1,15 +1,8 @@ Errors: -#E.f3: field not allowed: - ./in.cue:1:5 - ./in.cue:27:5 - ./in.cue:27:10 - ./in.cue:28:2 - ./in.cue:29:3 a.f3: field not allowed: - ./in.cue:1:5 - ./in.cue:3:1 - ./in.cue:4:5 - ./in.cue:4:11 + ./in.cue:4:19 +#E.f3: field not allowed: + ./in.cue:29:11 Result: (_|_){ @@ -24,10 +17,7 @@ f2: (int){ int } f3: (_|_){ // [eval] a.f3: field not allowed: - // ./in.cue:1:5 - // ./in.cue:3:1 - // ./in.cue:4:5 - // ./in.cue:4:11 + // ./in.cue:4:19 } } #B: (#struct){ @@ -45,11 +35,7 @@ f2: (int){ int } f3: (_|_){ // [eval] #E.f3: field not allowed: - // ./in.cue:1:5 - // ./in.cue:27:5 - // ./in.cue:27:10 - // ./in.cue:28:2 - // ./in.cue:29:3 + // ./in.cue:29:11 } } } -- diff/todo/p2 -- error positions -- out/eval -- Errors: #E.f3: field not allowed: ./in.cue:1:5 ./in.cue:27:5 ./in.cue:27:10 ./in.cue:28:2 ./in.cue:29:3 a.f3: field not allowed: ./in.cue:1:5 ./in.cue:3:1 ./in.cue:4:5 ./in.cue:4:11 Result: (_|_){ // [eval] #A: (#struct){ f1: (int){ int } f2: (int){ int } } a: (_|_){ // [eval] f1: (int){ int } f2: (int){ int } f3: (_|_){ // [eval] a.f3: field not allowed: // ./in.cue:1:5 // ./in.cue:3:1 // ./in.cue:4:5 // ./in.cue:4:11 } } #B: (#struct){ f1: (int){ int } } #C: (#struct){ f1: (int){ int } } #D: (#struct){ f1: (int){ int } } #E: (_|_){ // [eval] f1: (int){ int } f2: (int){ int } f3: (_|_){ // [eval] #E.f3: field not allowed: // ./in.cue:1:5 // ./in.cue:27:5 // ./in.cue:27:10 // ./in.cue:28:2 // ./in.cue:29:3 } } }