| # DO NOT EDIT; generated by go run testdata/gen.go |
| # |
| #name: issue314 |
| #evalFull |
| -- in.cue -- |
| import ( |
| "text/template" |
| "encoding/yaml" |
| "encoding/json" |
| ) |
| |
| x: { |
| s: "myname" |
| #T |
| } |
| |
| #T: { |
| s: string |
| out: template.Execute("{{.s}}", { |
| "s": s |
| }) |
| } |
| |
| #V: { |
| s: string |
| out: json.Marshal({"s": s}) |
| } |
| |
| #U: { |
| s: string |
| out: yaml.Marshal({"s": s}) |
| } |
| -- out/def -- |
| import ( |
| "encoding/json" |
| "encoding/yaml" |
| "text/template" |
| ) |
| |
| x: { |
| s: "myname" |
| #T |
| } |
| #T: { |
| s: string |
| S = s |
| out: template.Execute("{{.s}}", { |
| s: S |
| }) |
| } |
| #V: { |
| s: string |
| S658221 = s |
| out: json.Marshal({ |
| s: S658221 |
| }) |
| } |
| #U: { |
| s: string |
| S629a0f = s |
| out: yaml.Marshal({ |
| s: S629a0f |
| }) |
| } |
| -- out/export -- |
| x: { |
| s: "myname" |
| out: "myname" |
| } |
| -- out/yaml -- |
| x: |
| s: myname |
| out: myname |
| -- out/json -- |
| {"x":{"s":"myname","out":"myname"}} |
| -- out/legacy-debug -- |
| <0>{x: <1>C{s: "myname", out: "myname"}, #T: <2>C{s: string, out: <3>.Execute ("{{.s}}",<4>C{s: <5>.s})}, #V: <6>C{s: string, out: <7>.Marshal (<8>C{s: <9>.s})}, #U: <10>C{s: string, out: <11>.Marshal (<12>C{s: <13>.s})}} |
| -- out/eval -- |
| (struct){ |
| x: (#struct){ |
| s: (string){ "myname" } |
| out: (string){ "myname" } |
| } |
| #T: (#struct){ |
| s: (string){ string } |
| out: (_|_){ |
| // [incomplete] error in call to text/template.Execute: cannot convert non-concrete value string: |
| // ./in.cue:14:7 |
| // ./in.cue:15:3 |
| } |
| } |
| #V: (#struct){ |
| s: (string){ string } |
| out: (_|_){ |
| // [incomplete] cannot convert incomplete value "string" to JSON |
| } |
| } |
| #U: (#struct){ |
| s: (string){ string } |
| out: (_|_){ |
| // [incomplete] #U.out: incomplete value: |
| // ./in.cue:26:7 |
| } |
| } |
| } |
| -- out/compile -- |
| --- in.cue |
| { |
| x: { |
| s: "myname" |
| 〈1;#T〉 |
| } |
| #T: { |
| s: string |
| out: 〈import;"text/template"〉.Execute("{{.s}}", { |
| s: 〈1;s〉 |
| }) |
| } |
| #V: { |
| s: string |
| out: 〈import;"encoding/json"〉.Marshal({ |
| s: 〈1;s〉 |
| }) |
| } |
| #U: { |
| s: string |
| out: 〈import;"encoding/yaml"〉.Marshal({ |
| s: 〈1;s〉 |
| }) |
| } |
| } |