cue
cue copied to clipboard
evaluator: non-package CUE fails to complain about superfluous import
What version of CUE are you using (cue version)?
$ cue version
cue version v0.0.0-20220808083940-b4d1b16ccf89
-compiler gc
CGO_ENABLED 1
GOARCH arm64
GOOS linux
vcs git
vcs.revision b4d1b16ccf8944599eec6870da400d2b56da979b
vcs.time 2022-08-08T08:39:40Z
vcs.modified false
Does this issue reproduce with the latest release?
Yes
What did you do?
! exec cue eval x.cue
cmp stderr stderr.golden
-- x.cue --
import "list"
x: 5
-- stderr.golden --
imported and not used: "list":
./x.cue:1:8
What did you expect to see?
Passing test.
What did you see instead?
> ! exec cue eval x.cue
[stdout]
x: 5
FAIL: /tmp/testscript3669738402/repro.txtar/script.txt:1: unexpected command success
If you add a package class to x.cue the cue eval fails as expected (modulo line numbers).
FYI @rogpeppe @mpvl - raising this after we spotted it recently.