| # DO NOT EDIT; generated by go run testdata/gen.go |
| # |
| #name: Issue #153 |
| #evalFull |
| -- in.cue -- |
| Foo: { |
| listOfCloseds: [...#Closed] |
| } |
| |
| #Closed: { |
| a: int | *0 |
| } |
| |
| Junk: { |
| b: 2 |
| } |
| |
| Foo & { |
| listOfCloseds: [{ |
| for k, v in Junk { |
| "\(k)": v |
| } |
| }] |
| } |
| -- out/def -- |
| Foo: { |
| listOfCloseds: [...#Closed] |
| } |
| listOfCloseds: [_|_, // field "b" not allowed in closed struct |
| ] |
| #Closed: { |
| a: int | *0 |
| } |
| Junk: { |
| b: 2 |
| } |
| -- out/legacy-debug -- |
| <0>{<1>{listOfCloseds: [_|_(<2>.v:field "b" not allowed in closed struct)]}, Foo: <3>{listOfCloseds: []}, #Closed: <4>C{a: 0}, Junk: <5>{b: 2}} |
| -- out/compile -- |
| --- in.cue |
| { |
| Foo: { |
| listOfCloseds: [ |
| ...〈1;#Closed〉, |
| ] |
| } |
| #Closed: { |
| a: (int|*0) |
| } |
| Junk: { |
| b: 2 |
| } |
| (〈0;Foo〉 & { |
| listOfCloseds: [ |
| { |
| for k, v in 〈2;Junk〉 { |
| "\(〈1;k〉)": 〈1;v〉 |
| } |
| }, |
| ] |
| }) |
| } |
| -- out/eval -- |
| Errors: |
| listOfCloseds.0: field not allowed: b: |
| ./in.cue:2:21 |
| ./in.cue:5:10 |
| ./in.cue:13:1 |
| ./in.cue:14:18 |
| ./in.cue:15:3 |
| ./in.cue:16:4 |
| |
| Result: |
| (_|_){ |
| // [eval] |
| listOfCloseds: (_|_){ |
| // [eval] |
| 0: (_|_){ |
| // [eval] |
| a: (int){ |(*(int){ 0 }, (int){ int }) } |
| b: (_|_){ |
| // [eval] listOfCloseds.0: field not allowed: b: |
| // ./in.cue:2:21 |
| // ./in.cue:5:10 |
| // ./in.cue:13:1 |
| // ./in.cue:14:18 |
| // ./in.cue:15:3 |
| // ./in.cue:16:4 |
| } |
| } |
| } |
| Foo: (struct){ |
| listOfCloseds: (list){ |
| } |
| } |
| #Closed: (#struct){ |
| a: (int){ |(*(int){ 0 }, (int){ int }) } |
| } |
| Junk: (struct){ |
| b: (int){ 2 } |
| } |
| } |