cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
5.15k stars 297 forks source link

pkg/list: UniqueItems fails when it should not #3547

Closed rogpeppe closed 1 week ago

rogpeppe commented 3 weeks ago

What version of CUE are you using (cue version)?

73d4e255

Does this issue reproduce with the latest stable release?

Yes (v0.10.0)

What did you do?

exec cue-v0.10.0 vet x.cue

-- x.cue --
import "list"

#x: list.UniqueItems() & [_, _]

What did you expect to see?

Passing test. Although list.UniqueItems() is being unified with a noncrete value, it can later become concrete and correct.

What did you see instead?

> exec cue vet x.cue
[stderr]
#x: invalid value [_,_] (does not satisfy list.UniqueItems):
    ./x.cue:3:5
[exit status 1]
FAIL: /tmp/y.txtar:1: unexpected command failure

It seems like list.UniqueItems is giving a permanent error when it should be giving an incomplete error.