Open verdverm opened 2 years ago
Thanks for the report.
For the record, call.body
works, as does call.c.response.body
, but call.resp.body
does not.
The issue description doesn't seem quite right to me, as dependencies from encoding/json
are
clearly being recognized in some of the cases here.
Here's a more complete and slightly slimmed down reproducer:
exec cue cmd resp ./repro_tool.cue
-- repro_tool.cue --
import "encoding/json"
apicall: {
in: string
r: { $id: "tool/file.Read", filename: in, contents: string }
j: json.Unmarshal(r.contents)
c: {
$id: "tool/http.Do"
tls: verify: true
method: j.method
url: "https://\(j.host)\(j.path)"
response: body: string
}
resp: c.response
}
command: resp: {
call: apicall & { in: "req.json" }
final: { $id: "tool/cli.Print", text: call.resp.body }
}
-- req.json --
{
"method": "GET",
"host": "example.com",
"path": "/"
}
What version of CUE are you using (
cue version
)?v0.4.3-beta.1
Does this issue reproduce with the latest release?
yes: v0.4.2
What did you do?
The
cue cmd resp
case fails to detect the dependencyWhat did you expect to see?
What did you see instead?
in v0.4.2
the error message has improved and increased accuracy! (in the beta)